ITextStructureNavigator.GetSpanOfEnclosing Method (SnapshotSpan)

 

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

Namespace:   Microsoft.VisualStudio.Text.Operations
Assembly:  Microsoft.VisualStudio.Text.Logic (in Microsoft.VisualStudio.Text.Logic.dll)

SnapshotSpan GetSpanOfEnclosing(
	SnapshotSpan activeSpan
)

Parameters

activeSpan
Type: Microsoft.VisualStudio.Text.SnapshotSpan

The SnapshotSpan from which to get the enclosing syntactic element.

Return Value

Type: Microsoft.VisualStudio.Text.SnapshotSpan

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.

Return to top
Show: