IVsTextViewFilter::GetWordExtent Method (Int32, Int32, UInt32, array<TextSpan>^)

 

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)

int GetWordExtent(
	int iLine,
	int iIndex,
	unsigned int dwFlags,
	array<TextSpan>^ pSpan
)

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.

dwFlags
Type: System::UInt32

[in] Options for determining the word extent. For a list of dwFlags options, see WORDEXTFLAGS.

pSpan
Type: array<Microsoft.VisualStudio.TextManager.Interop::TextSpan>^

[out] Pointer to a span object identifying the word extent.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

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).

System_CAPS_noteNote

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

Return to top
Show: