Udostępnij za pośrednictwem


IVsLanguageContextProvider Interface

Definition

Connects context-sensitive help for a language service that uses the Visual Studio core editor. Hooks up context-sensitive help for a language service that uses the Visual Studio core editor.

public interface class IVsLanguageContextProvider
public interface class IVsLanguageContextProvider
__interface IVsLanguageContextProvider
[System.Runtime.InteropServices.Guid("19404D57-F8E4-42F4-9255-B8F889B0C50C")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsLanguageContextProvider
[System.Runtime.InteropServices.Guid("19404D57-F8E4-42F4-9255-B8F889B0C50C")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsLanguageContextProvider
[<System.Runtime.InteropServices.Guid("19404D57-F8E4-42F4-9255-B8F889B0C50C")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsLanguageContextProvider = interface
[<System.Runtime.InteropServices.Guid("19404D57-F8E4-42F4-9255-B8F889B0C50C")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsLanguageContextProvider = interface
Public Interface IVsLanguageContextProvider
Derived
Attributes

Remarks

This interface allows the text view to determine when it is time to update context in the Dynamic Help window, and allows the language service to push attributes and keywords to the context bag based on the current context in the editor. At an appropriate time (typically idle time), the language service is called with UpdateLanguageContext if it has implemented IVsLanguageContextProvider. The language service can then push context based on the text buffer, location, and supplemental hint information regarding whether this is a typical idle-time update or is a prelude to the Dynamic Help window handling the F1 key. There is no follow-up call to remove attributes or keywords from the context bag; the language service is responsible for managing the context in an appropriate manner and for not allowing extraneous attributes and keywords to accumulate in the context bag.

In this scenario, a context bag is attached to the default Visual Studio text editor, which is responsible for updating the context bag. When the Dynamic Help window calls Update on the context bag at idle time, the context bag informs the text editor that it needs to update; the text editor subsequently tells the language service that it is time to update and passes a pointer to the text editor's context bag, because, in this scenario, the language service does not have its own context bag. The language service then needs to call UpdateLanguageContext; then, using the pointer to the text editor's context bag, it can add and remove attributes and keywords.

Notes to Implementers

Implemented by the language service to provide context to the Visual Studio core editor.

Notes to Callers

Called by the text editor.

Methods

UpdateLanguageContext(UInt32, IVsTextLines, TextSpan[], Object)

Provides context from the language service to the Visual Studio core editor.

Applies to