FormatSpan Method

IVsExpansionClient.FormatSpan Method (IVsTextLines, TextSpan[])


Called to format the specified span in the specified text buffer.

Namespace:   Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

int FormatSpan(
	IVsTextLines pBuffer,
	TextSpan[] ts


Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextLines

[in] An IVsTextLines object that represents the text buffer which contains the text to be formatted.

Type: Microsoft.VisualStudio.TextManager.Interop.TextSpan[]

[in] A TextSpan object that describes the span (a pair of beginning and ending positions) of text that is to be formatted.

Return Value

Type: System.Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

From textmgr2.idl:

HRESULT IVsExpansionClient::FormatSpan(
   [in]IVsTextLines *pBuffer,
   [in]TextSpan *ts

The specified span describes the extent of the code snippet after it has been inserted. Formatting typically involves inserting tabs or spaces to position the snippet relative to the code around the snippet.

Return to top
© 2016 Microsoft