IVsLanguageTextOps.GetWordExtent Method
Returns the extent of a word or token on or near the point.
Namespace: Microsoft.VisualStudio.TextManager.Interop
Assembly: Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)
Syntax
‘선언
Function GetWordExtent ( _
pTextLayer As IVsTextLayer, _
ta As TextAddress, _
flags As WORDEXTFLAGS, _
<OutAttribute> pts As TextSpan() _
) As Integer
int GetWordExtent(
IVsTextLayer pTextLayer,
TextAddress ta,
WORDEXTFLAGS flags,
TextSpan[] pts
)
int GetWordExtent(
[InAttribute] IVsTextLayer^ pTextLayer,
[InAttribute] TextAddress ta,
[InAttribute] WORDEXTFLAGS flags,
[OutAttribute] array<TextSpan>^ pts
)
abstract GetWordExtent :
pTextLayer:IVsTextLayer *
ta:TextAddress *
flags:WORDEXTFLAGS *
pts:TextSpan[] byref -> int
function GetWordExtent(
pTextLayer : IVsTextLayer,
ta : TextAddress,
flags : WORDEXTFLAGS,
pts : TextSpan[]
) : int
Parameters
- pTextLayer
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextLayer
[in] An IVsTextLayer object representing the text file.
- ta
Type: Microsoft.VisualStudio.TextManager.Interop.TextAddress
[in] Specifies the text address of the characters to determine the word extent of. The text address is relative to the location of text within the text layer. For more information, see TextAddress.
- flags
Type: Microsoft.VisualStudio.TextManager.Interop.WORDEXTFLAGS
[in] Specifies options for determining the extent of a word. For more information, see WORDEXTFLAGS.
- pts
Type: array<Microsoft.VisualStudio.TextManager.Interop.TextSpan[]
[out] Returns the span of text identifying the whole word. For more information, see TextSpan.
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 IVsLanguageTextOps::GetWordExtent(
[in] IVsTextLayer *pTextLayer,
[in] TextAddress ta,
[in] WORDEXTFLAGS flags,
[out, retval] TextSpan *pts
);
For this method, the environment passes in a text layer and a text address identifying a character position and flags identifying how the word extent should be determined. Your language service then decides the extent of the word based on this information and you can pass this information back to the environment in a text span structure (pts).
.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.