IVsTextViewFilter.GetWordExtent Method

Calculates the word extent based on a character position.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

Syntax

'Déclaration
Function GetWordExtent ( _
    iLine As Integer, _
    iIndex As Integer, _
    dwFlags As UInteger, _
    <OutAttribute> pSpan As TextSpan() _
) As Integer
'Utilisation
Dim instance As IVsTextViewFilter
Dim iLine As Integer
Dim iIndex As Integer
Dim dwFlags As UInteger
Dim pSpan As TextSpan()
Dim returnValue As Integer

returnValue = instance.GetWordExtent(iLine, _
    iIndex, dwFlags, pSpan)
int GetWordExtent(
    int iLine,
    int iIndex,
    uint dwFlags,
    TextSpan[] pSpan
)
int GetWordExtent(
    [InAttribute] int iLine, 
    [InAttribute] int iIndex, 
    [InAttribute] unsigned int dwFlags, 
    [OutAttribute] array<TextSpan>^ pSpan
)
abstract GetWordExtent : 
        iLine:int * 
        iIndex:int * 
        dwFlags:uint32 * 
        pSpan:TextSpan[] byref -> int 
function GetWordExtent(
    iLine : int, 
    iIndex : int, 
    dwFlags : uint, 
    pSpan : TextSpan[]
) : int

Parameters

  • iLine
    Type: System.Int32
    [in] Integer containing the line index of the character.
  • iIndex
    Type: System.Int32
    [in] Integer containing the column index of the character.

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 IVsTextViewFilter::GetWordExtent(
   [in] long iLine,
   [in] CharIndex iIndex,
   [in] DWORD dwFlags,
   [out] TextSpan * pSpan
);

For this method, the environment passes in a line and column index 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 (pSpan).

Notes

The text span returned in pSpan must contain the original character specified by iLine and iIndex.

.NET Framework Security

See Also

Reference

IVsTextViewFilter Interface

IVsTextViewFilter Members

Microsoft.VisualStudio.TextManager.Interop Namespace