Source.GetWordExtent Method

Gets the span occupied by the word at the specified location.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'Declaration
Public Function GetWordExtent ( _
    line As Integer, _
    idx As Integer, _
    flags As WORDEXTFLAGS, _
    <OutAttribute> ByRef startIdx As Integer, _
    <OutAttribute> ByRef endIdx As Integer _
) As Boolean
public bool GetWordExtent(
    int line,
    int idx,
    WORDEXTFLAGS flags,
    out int startIdx,
    out int endIdx
)
public:
bool GetWordExtent(
    int line, 
    int idx, 
    WORDEXTFLAGS flags, 
    [OutAttribute] int% startIdx, 
    [OutAttribute] int% endIdx
)
member GetWordExtent : 
        line:int * 
        idx:int * 
        flags:WORDEXTFLAGS * 
        startIdx:int byref * 
        endIdx:int byref -> bool
public function GetWordExtent(
    line : int, 
    idx : int, 
    flags : WORDEXTFLAGS, 
    startIdx : int, 
    endIdx : int
) : boolean

Parameters

  • line
    Type: Int32

    The line on which the word to examine is located.

  • idx
    Type: Int32

    The offset into the line to somewhere in the word (does not have to be at the beginning of the word).

  • startIdx
    Type: Int32%

    [out] Returns the offset of the first character of the word.

  • endIdx
    Type: Int32%

    [out] Returns the offset of the character one past the last character of the word.

Return Value

Type: Boolean
true if the word was found; otherwise, false, meaning that there is no word at that position.

Remarks

This method calls the colorizer's GetLineInfo method to obtain the list of tokens for the specified line. Then using the token list and the specified flags, this method proceeds to find the requested token.

.NET Framework Security

See Also

Reference

Source Class

Microsoft.VisualStudio.Package Namespace