Source.GetPairExtents Method

Definition

Gets the text span between a matching pair (or triplet) of language elements.

Overloads

GetPairExtents(IVsTextView, Int32, Int32, TextSpan)

Gets the span between a matching pair of language elements.

GetPairExtents(IVsTextView, Int32, Int32, TextSpan, TextSpan)

Gets the text spans for a matching pair (or triplet) of language elements.

Remarks

A matching pair of elements is any supported set of language elements, such as { and }, ( and ), [ and ], or < and >.

GetPairExtents(IVsTextView, Int32, Int32, TextSpan)

Gets the span between a matching pair of language elements.

public:
 virtual void GetPairExtents(Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ textView, int line, int col, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan % span);
public:
 virtual void GetPairExtents(Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ textView, int line, int col, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan &  span);
 virtual void GetPairExtents(Microsoft::VisualStudio::TextManager::Interop::IVsTextView const & textView, int line, int col, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan & span);
public virtual void GetPairExtents (Microsoft.VisualStudio.TextManager.Interop.IVsTextView textView, int line, int col, out Microsoft.VisualStudio.TextManager.Interop.TextSpan span);
abstract member GetPairExtents : Microsoft.VisualStudio.TextManager.Interop.IVsTextView * int * int * TextSpan -> unit
override this.GetPairExtents : Microsoft.VisualStudio.TextManager.Interop.IVsTextView * int * int * TextSpan -> unit
Public Overridable Sub GetPairExtents (textView As IVsTextView, line As Integer, col As Integer, ByRef span As TextSpan)

Parameters

textView
IVsTextView

The IVsTextView that contains the text that contains the matching language elements.

line
Int32

The line number.

col
Int32

The column number.

span
TextSpan

[out] A TextSpan that contains the matching language elements.

Remarks

If the location lies between two paired elements, the returned span starts at the starting element and ends with the closing element.

Applies to

GetPairExtents(IVsTextView, Int32, Int32, TextSpan, TextSpan)

Gets the text spans for a matching pair (or triplet) of language elements.

public:
 virtual bool GetPairExtents(Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ textView, int line, int col, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan % startBraceSpan, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan % endBraceSpan);
public:
 virtual bool GetPairExtents(Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ textView, int line, int col, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan &  startBraceSpan, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan &  endBraceSpan);
 virtual bool GetPairExtents(Microsoft::VisualStudio::TextManager::Interop::IVsTextView const & textView, int line, int col, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan & startBraceSpan, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan & endBraceSpan);
public virtual bool GetPairExtents (Microsoft.VisualStudio.TextManager.Interop.IVsTextView textView, int line, int col, out Microsoft.VisualStudio.TextManager.Interop.TextSpan startBraceSpan, out Microsoft.VisualStudio.TextManager.Interop.TextSpan endBraceSpan);
abstract member GetPairExtents : Microsoft.VisualStudio.TextManager.Interop.IVsTextView * int * int * TextSpan * TextSpan -> bool
override this.GetPairExtents : Microsoft.VisualStudio.TextManager.Interop.IVsTextView * int * int * TextSpan * TextSpan -> bool
Public Overridable Function GetPairExtents (textView As IVsTextView, line As Integer, col As Integer, ByRef startBraceSpan As TextSpan, ByRef endBraceSpan As TextSpan) As Boolean

Parameters

textView
IVsTextView

The IVsTextView that contains the text that contains the matching language elements.

line
Int32

The line number.

col
Int32

The column number.

startBraceSpan
TextSpan

[out] The Microsoft.VisualStudio.TextManager.Interop.IVsTextSpan that contains the starting element.

endBraceSpan
TextSpan

[out] The Microsoft.VisualStudio.TextManager.Interop.IVsTextSpan that contains the end element.

Returns

true if the pair was found, otherwise false.

Remarks

This method performs a BeginParse operation with MatchBraces and a <xref:Microsoft.VisualStudio.Package.ParseResultHandler%2A> of <xref:Microsoft.VisualStudio.Package.Source.HandleGetPairExtentResponse%2A> and returns the starting and ending <xref:Microsoft.VisualStudio.TextManager.Interop.IVsTextSpan> objects.

Applies to