ITextStructureNavigator Interface

ITextStructureNavigator Interface

 

Provides methods to navigate text, such as getting word extents.

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

No code example is currently available or this language may not be supported.

NameDescription
System_CAPS_pubpropertyContentType

Gets the content type that this navigator supports.

NameDescription
System_CAPS_pubmethodGetExtentOfWord(SnapshotPoint)

Gets the extent of the word at the given position.

System_CAPS_pubmethodGetSpanOfEnclosing(SnapshotSpan)

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

System_CAPS_pubmethodGetSpanOfFirstChild(SnapshotSpan)

Gets the span of the first child syntactic element of the specified snapshot span.

System_CAPS_pubmethodGetSpanOfNextSibling(SnapshotSpan)

Gets the span of the next sibling syntactic element of the specified snapshot span.

System_CAPS_pubmethodGetSpanOfPreviousSibling(SnapshotSpan)

Gets the span of the previous sibling syntactic element of the specified snapshot span.

Implement this interface if you need to provide a special definition of a word extent in your language or content type, or if you need to define a special relationship between sibling or parent/child syntactic elements. To use it in your extension, you must also implement (in a separate class) the ITextStructureNavigatorProvider so that it creates a navigator of your type, and export this class for your content type. In this case the ITextStructureNavigatorSelectorService will assign your navigator to buffers that have the correct content type.

For an example of how to use the navigator and the navigator provider to get word extents, see Walkthrough: Displaying SmartTags.

Return to top
Show:
© 2016 Microsoft