IVsLanguageTextOps::GetPairExtent Method (IVsTextLayer^, TextAddress, array<TextSpan>^)

 

Determines the location of a matching brace, parenthesis, quotation mark, bracket, or any other item the language service wants to match.

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

int GetPairExtent(
	IVsTextLayer^ pTextLayer,
	TextAddress ta,
	array<TextSpan>^ pts
)

Parameters

pTextLayer
Type: Microsoft.VisualStudio.TextManager.Interop::IVsTextLayer^

[in] An IVsTextLayer object representing the text file.

ta
Type: Microsoft.VisualStudio.TextManager.Interop::TextAddress

[in] Specifies the text address of the first item in the pair. The text address is relative to the location of text within the text layer. For more information, see TextAddress.

pts
Type: array<Microsoft.VisualStudio.TextManager.Interop::TextSpan>^

[out] Returns the span of text containing the second item in the pair. For more information, see TextSpan.

Return Value

Type: System::Int32

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

From textmgr.idl:

HRESULT IVsLanguageTextOps::GetPairExtent(
   [in] IVsTextLayer *pTextLayer, 
   [in] TextAddress ta, 
   [out, retval] TextSpan *pts
);

Pair characters include braces, parentheses, quotes, brackets, and so on.

System_CAPS_noteNote

The pts value is a text span in the corresponding layer that was passed in (that is, in pTextLayer). Do not return this as a text span from the base layer (the text buffer).

Return to top
Show: