Assembly: Microsoft.VisualStudio.TextManager.Interop (in microsoft.visualstudio.textmanager.interop.dll)
[GuidAttribute("F1671B6B-1090-4DFF-BBFD-133EB428BB6C")] [InterfaceTypeAttribute(1)] public interface IVsTextMarkerContextProvider
/** @attribute GuidAttribute("F1671B6B-1090-4DFF-BBFD-133EB428BB6C") */ /** @attribute InterfaceTypeAttribute(1) */ public interface IVsTextMarkerContextProvider
For each text marker type in the core editor, the environment creates a separate IVsTextMarkerContextProvider object (text marker). Whenever the cursor in an editor is over a text marker, the environment queries to see if the IVsTextMarkerContextProvider interface is implemented. If this interface is implemented, then the environment callsand passes a pointer to the context bag for the editor. Write your implementation of this method so that when called by the environment, you update the context for the text marker in the editor's context bag. For more information, see IVsUserContext:: .
When the editor's cursor moves off of the text marker, the environment calls UpdateContextForMarker and passes you a pointer to the editor's context bag to allow you to remove the context for the last text marker. For more information, see.
The Visual Studio core editor provides the text marker in addition to the keyword at the cursor during updates.
Use the following steps to add context for text markers to the Dynamic Help window:
Turn on thevisual style bit by calling and specifying this value.
When you create the text marker, pass in a text marker client () that also implements IVsTextMarkerContextProvider.
Your IVsTextMarkerContextProvider implementation is called twice every time context is to be added, once when the context is added and once more when the context is to be removed.Notes to Implementers Implemented by the language service to provide context for text markers (for example, compiler errors) in the Visual Studio core editor. The core editor calls QueryInterface on to return a pointer to IVsTextMarkerContextProvider. Notes to Callers Called by the Visual Studio core editor to indicate that context is updating.