IVsTextViewFilter.GetWordExtent(Int32, Int32, UInt32, TextSpan[]) Method

Definition

Calculates the word extent based on a character position.

public:
 int GetWordExtent(int iLine, int iIndex, System::UInt32 dwFlags, cli::array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ pSpan);
public:
 int GetWordExtent(int iLine, int iIndex, unsigned int dwFlags, Platform::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ pSpan);
int GetWordExtent(int iLine, int iIndex, unsigned int dwFlags, std::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> const & pSpan);
public int GetWordExtent (int iLine, int iIndex, uint dwFlags, Microsoft.VisualStudio.TextManager.Interop.TextSpan[] pSpan);
abstract member GetWordExtent : int * int * uint32 * Microsoft.VisualStudio.TextManager.Interop.TextSpan[] -> int
Public Function GetWordExtent (iLine As Integer, iIndex As Integer, dwFlags As UInteger, pSpan As TextSpan()) As Integer

Parameters

iLine
Int32

[in] Integer containing the line index of the character.

iIndex
Int32

[in] Integer containing the column index of the character.

dwFlags
UInt32

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

pSpan
TextSpan[]

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

Returns

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

Remarks

COM Signature

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

Note

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

Applies to