Source::GetWordExtent Method (Int32, Int32, WORDEXTFLAGS, Int32, Int32)

 

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

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

public:
bool GetWordExtent(
	int line,
	int idx,
	WORDEXTFLAGS flags,
	[OutAttribute] int% startIdx,
	[OutAttribute] 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.

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.

Return to top
Show: