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)

public interface ITextStructureNavigator

The ITextStructureNavigator type exposes the following members.

  NameDescription
Public propertyContentTypeGets the content type that this navigator supports.
Top

  NameDescription
Public methodGetExtentOfWordGets the extent of the word at the given position.
Public methodGetSpanOfEnclosingGets the span of the enclosing syntactic element of the specified snapshot span.
Public methodGetSpanOfFirstChildGets the span of the first child syntactic element of the specified snapshot span.
Public methodGetSpanOfNextSiblingGets the span of the next sibling syntactic element of the specified snapshot span.
Public methodGetSpanOfPreviousSiblingGets the span of the previous sibling syntactic element of the specified snapshot span.
Top

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.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft