Sdílet prostřednictvím


ViewFilter.GetPairExtents(Int32, Int32, TextSpan[]) Method

Definition

Returns the extent of the innermost matching pair of language elements that contains the given location.

public:
 virtual int GetPairExtents(int line, int index, cli::array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ span);
public:
 virtual int GetPairExtents(int line, int index, Platform::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ span);
 virtual int GetPairExtents(int line, int index, std::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> const & span);
public virtual int GetPairExtents (int line, int index, Microsoft.VisualStudio.TextManager.Interop.TextSpan[] span);
abstract member GetPairExtents : int * int * Microsoft.VisualStudio.TextManager.Interop.TextSpan[] -> int
override this.GetPairExtents : int * int * Microsoft.VisualStudio.TextManager.Interop.TextSpan[] -> int
Public Overridable Function GetPairExtents (line As Integer, index As Integer, span As TextSpan()) As Integer

Parameters

line
Int32

[in] The line number of the location to examine.

index
Int32

[in] The character offset on the line to examine.

span
TextSpan[]

[out] A TextSpan object specifying the extent of the enclosing matching pair of language elements.

Returns

If successful, returns S_OK; otherwise, returns an error code.

Implements

Remarks

This method is called to retrieve the span that encompasses the innermost matching pair of language elements (such as "{" and "}" in C# or "<" and ">" in XML) that contains the specified location.

This method is an implementation of the GetPairExtents method on the IVsTextViewFilter interface.

The base method validates the parameters, and then forwards the call to the GetPairExtents method on the Source object that was obtained in the ViewFilter constructor.

Applies to