IVsLanguageTextOps::GetWordExtent Method (IVsTextLayer^, TextAddress, WORDEXTFLAGS, array<TextSpan>^)
Returns the extent of a word or token on or near the point.
Assembly: Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)
int GetWordExtent( IVsTextLayer^ pTextLayer, TextAddress ta, WORDEXTFLAGS flags, array<TextSpan>^ pts )
Parameters
- pTextLayer
-
Type:
Microsoft.VisualStudio.TextManager.Interop::IVsTextLayer^
[in] An IVsTextLayer object representing the text file.
- ta
-
Type:
Microsoft.VisualStudio.TextManager.Interop::TextAddress
[in] Specifies the text address of the characters to determine the word extent of. The text address is relative to the location of text within the text layer. For more information, see TextAddress.
- flags
-
Type:
Microsoft.VisualStudio.TextManager.Interop::WORDEXTFLAGS
[in] Specifies options for determining the extent of a word. For more information, see WORDEXTFLAGS.
- pts
-
Type:
array<Microsoft.VisualStudio.TextManager.Interop::TextSpan>^
[out] Returns the span of text identifying the whole word. For more information, see TextSpan.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
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).