Aracılığıyla paylaş


ITextStructureNavigator.GetSpanOfEnclosing(SnapshotSpan) Method

Definition

Gets the span of the enclosing syntactic element of the specified snapshot span.

public:
 Microsoft::VisualStudio::Text::SnapshotSpan GetSpanOfEnclosing(Microsoft::VisualStudio::Text::SnapshotSpan activeSpan);
Microsoft::VisualStudio::Text::SnapshotSpan GetSpanOfEnclosing(Microsoft::VisualStudio::Text::SnapshotSpan activeSpan);
public Microsoft.VisualStudio.Text.SnapshotSpan GetSpanOfEnclosing (Microsoft.VisualStudio.Text.SnapshotSpan activeSpan);
abstract member GetSpanOfEnclosing : Microsoft.VisualStudio.Text.SnapshotSpan -> Microsoft.VisualStudio.Text.SnapshotSpan
Public Function GetSpanOfEnclosing (activeSpan As SnapshotSpan) As SnapshotSpan

Parameters

activeSpan
SnapshotSpan

The SnapshotSpan from which to get the enclosing syntactic element.

Returns

A SnapshotSpan that represents the enclosing syntactic element. If the specified snapshot span covers multiple syntactic elements, then the method returns the least common ancestor of the elements. If the snapshot span covers the root element (in other words, the whole document), then the method returns SnapshotSpan of the whole document.

Applies to