Source.GetWordExtent Method
Gets the span occupied by the word at the specified location.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.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)
Syntax
'Declaração
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
)
Parameters
- line
Type: System.Int32
The line on which the word to examine is located.
- idx
Type: System.Int32
The offset into the line to somewhere in the word (does not have to be at the beginning of the word).
- flags
Type: Microsoft.VisualStudio.TextManager.Interop.WORDEXTFLAGS
A combination of flags from the WORDEXTFLAGS enumeration.
- startIdx
Type: System.Int32%
[out] Returns the offset of the first character of the word.
- endIdx
Type: System.Int32%
[out] Returns the offset of the character one past the last character of the word.
Return Value
Type: System.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
- 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.