Source.GetPairExtents Method (IVsTextView, Int32, Int32, TextSpan%)

Returns the span that encompasses a matching pair of language elements between which is the given location.

Namespace:  Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)

Syntax

'宣言
Public Overridable Sub GetPairExtents ( _
    textView As IVsTextView, _
    line As Integer, _
    col As Integer, _
    <OutAttribute> ByRef span As TextSpan _
)
'使用
Dim instance As Source
Dim textView As IVsTextView
Dim line As Integer
Dim col As Integer
Dim span As TextSpan

instance.GetPairExtents(textView, line, _
    col, span)
public virtual void GetPairExtents(
    IVsTextView textView,
    int line,
    int col,
    out TextSpan span
)
public:
virtual void GetPairExtents(
    IVsTextView^ textView, 
    int line, 
    int col, 
    [OutAttribute] TextSpan% span
)
public function GetPairExtents(
    textView : IVsTextView, 
    line : int, 
    col : int, 
    span : TextSpan
)

Parameters

Remarks

A matching pair of elements is any supported language element such as { and }, ( and ), [ and ], or < and >. If the given location lies between two paired elements, the returned span goes from the first or opening paired element to the second or closing paired element and includes the paired elements.

The base method executes a parse of the source with the reason MatchBraces and starting at the given location. It then examines the list of matching braces to find the innermost containing pair. The base method also examines any matching triplets and treats them as containing pairs.

Permissions

See Also

Reference

Source Class

Source Members

GetPairExtents Overload

Microsoft.VisualStudio.Package Namespace