Udostępnij za pośrednictwem


IVsTextMarkerContextProvider Interface

Definition

Provides context for text markers in the core editor.

public interface class IVsTextMarkerContextProvider
public interface class IVsTextMarkerContextProvider
__interface IVsTextMarkerContextProvider
[System.Runtime.InteropServices.Guid("F1671B6B-1090-4DFF-BBFD-133EB428BB6C")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsTextMarkerContextProvider
[System.Runtime.InteropServices.Guid("F1671B6B-1090-4DFF-BBFD-133EB428BB6C")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsTextMarkerContextProvider
[<System.Runtime.InteropServices.Guid("F1671B6B-1090-4DFF-BBFD-133EB428BB6C")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsTextMarkerContextProvider = interface
[<System.Runtime.InteropServices.Guid("F1671B6B-1090-4DFF-BBFD-133EB428BB6C")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsTextMarkerContextProvider = interface
Public Interface IVsTextMarkerContextProvider
Attributes

Remarks

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 calls UpdateContextForMarker and 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::AddAttribute.

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 RemoveAttribute.

Note

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:

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 IVsTextLayerMarker to return a pointer to IVsTextMarkerContextProvider.

Notes to Callers

Called by the Visual Studio core editor to indicate that context is updating.

Methods

RemoveLastContext(UInt32, Object)

Deprecated. Do not use.

UpdateContextForMarker(UInt32, Object)

Called by the language service to indicate that the context for a text marker should be added to the context bag.

Applies to