IVsLanguageContextProvider.UpdateLanguageContext Method
Provides context from the language service to the Visual Studio core editor.
Namespace: Microsoft.VisualStudio.TextManager.Interop
Assembly: Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)
Syntax
声明
Function UpdateLanguageContext ( _
dwHint As UInteger, _
pBuffer As IVsTextLines, _
ptsSelection As TextSpan(), _
pUC As Object _
) As Integer
用法
Dim instance As IVsLanguageContextProvider
Dim dwHint As UInteger
Dim pBuffer As IVsTextLines
Dim ptsSelection As TextSpan()
Dim pUC As Object
Dim returnValue As Integer
returnValue = instance.UpdateLanguageContext(dwHint, _
pBuffer, ptsSelection, pUC)
int UpdateLanguageContext(
uint dwHint,
IVsTextLines pBuffer,
TextSpan[] ptsSelection,
Object pUC
)
int UpdateLanguageContext(
unsigned int dwHint,
IVsTextLines^ pBuffer,
array<TextSpan>^ ptsSelection,
Object^ pUC
)
abstract UpdateLanguageContext :
dwHint:uint32 *
pBuffer:IVsTextLines *
ptsSelection:TextSpan[] *
pUC:Object -> int
function UpdateLanguageContext(
dwHint : uint,
pBuffer : IVsTextLines,
ptsSelection : TextSpan[],
pUC : Object
) : int
Parameters
- dwHint
Type: System.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
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextLines
[in] Text buffer in question.
- ptsSelection
Type: array<Microsoft.VisualStudio.TextManager.Interop.TextSpan[]
[in] Relevant range of text within the buffer (that is, the context).
- pUC
Type: System.Object
[in, out] Pointer to the context bag on the Visual Studio core text editor.
Return Value
Type: System.Int32
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
IVsLanguageContextProvider Interface