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
textView
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextViewAn IVsTextView object that represents the view containing the source to examine.
line
Type: System.Int32The line number in the source.
col
Type: System.Int32The offset on the line.
span
Type: Microsoft.VisualStudio.TextManager.Interop.TextSpan%[out] A TextSpan object containing the span of the enclosing paired elements.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.