Compartir a través de


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

'Declaración
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

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

See Also

Reference

IVsLanguageTextOps Interface

Microsoft.VisualStudio.TextManager.Interop Namespace