Sdílet prostřednictvím


IVsLanguageContextProvider.UpdateLanguageContext Method

Definition

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

public:
 int UpdateLanguageContext(System::UInt32 dwHint, Microsoft::VisualStudio::TextManager::Interop::IVsTextLines ^ pBuffer, cli::array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ ptsSelection, System::Object ^ pUC);
public:
 int UpdateLanguageContext(unsigned int dwHint, Microsoft::VisualStudio::TextManager::Interop::IVsTextLines ^ pBuffer, Platform::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ ptsSelection, Platform::Object ^ pUC);
int UpdateLanguageContext(unsigned int dwHint, Microsoft::VisualStudio::TextManager::Interop::IVsTextLines const & pBuffer, std::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> const & ptsSelection, winrt::Windows::Foundation::IInspectable const & pUC);
public int UpdateLanguageContext (uint dwHint, Microsoft.VisualStudio.TextManager.Interop.IVsTextLines pBuffer, Microsoft.VisualStudio.TextManager.Interop.TextSpan[] ptsSelection, object pUC);
abstract member UpdateLanguageContext : uint32 * Microsoft.VisualStudio.TextManager.Interop.IVsTextLines * Microsoft.VisualStudio.TextManager.Interop.TextSpan[] * obj -> int
Public Function UpdateLanguageContext (dwHint As UInteger, pBuffer As IVsTextLines, ptsSelection As TextSpan(), pUC As Object) As Integer

Parameters

dwHint
UInt32

[in] Value indicating whether this is a typical idle-time update of the context bag or a request for F1 Help. For a list of dwHint values, see LanguageContextHint.

pBuffer
IVsTextLines

[in] Text buffer in question.

ptsSelection
TextSpan[]

[in] Relevant range of text within the buffer (that is, the context).

pUC
Object

[in, out] Pointer to the context bag on the Visual Studio core text editor.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsLanguageContextProvider::UpdateLanguageContext(  
   DWORD dwHint,   
   IVsTextLines *pBuffer,   
   TextSpan *ptsSelection  
);  

UpdateLanguageContext return values:

S_OK: the implementer has added whatever context should be added.

Any other success code: forbidden (caller will assert).

Any failure code: means the implementer is "passing" on this opportunity to provide context and the text editor will fall back to other mechanisms.

Applies to