Compartir a través de


IVsLanguageTextOps.GetWordExtent Method

Definition

Returns the extent of a word or token on or near the point.

public:
 int GetWordExtent(Microsoft::VisualStudio::TextManager::Interop::IVsTextLayer ^ pTextLayer, Microsoft::VisualStudio::TextManager::Interop::TextAddress ta, Microsoft::VisualStudio::TextManager::Interop::WORDEXTFLAGS flags, cli::array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ pts);
public:
 int GetWordExtent(Microsoft::VisualStudio::TextManager::Interop::IVsTextLayer ^ pTextLayer, Microsoft::VisualStudio::TextManager::Interop::TextAddress ta, Microsoft::VisualStudio::TextManager::Interop::WORDEXTFLAGS flags, Platform::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ pts);
int GetWordExtent(Microsoft::VisualStudio::TextManager::Interop::IVsTextLayer const & pTextLayer, Microsoft::VisualStudio::TextManager::Interop::TextAddress ta, Microsoft::VisualStudio::TextManager::Interop::WORDEXTFLAGS flags, std::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> const & pts);
public int GetWordExtent (Microsoft.VisualStudio.TextManager.Interop.IVsTextLayer pTextLayer, Microsoft.VisualStudio.TextManager.Interop.TextAddress ta, Microsoft.VisualStudio.TextManager.Interop.WORDEXTFLAGS flags, Microsoft.VisualStudio.TextManager.Interop.TextSpan[] pts);
abstract member GetWordExtent : Microsoft.VisualStudio.TextManager.Interop.IVsTextLayer * Microsoft.VisualStudio.TextManager.Interop.TextAddress * Microsoft.VisualStudio.TextManager.Interop.WORDEXTFLAGS * Microsoft.VisualStudio.TextManager.Interop.TextSpan[] -> int
Public Function GetWordExtent (pTextLayer As IVsTextLayer, ta As TextAddress, flags As WORDEXTFLAGS, pts As TextSpan()) As Integer

Parameters

pTextLayer
IVsTextLayer

[in] An IVsTextLayer object representing the text file.

ta
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
WORDEXTFLAGS

[in] Specifies options for determining the extent of a word. For more information, see WORDEXTFLAGS.

pts
TextSpan[]

[out] Returns the span of text identifying the whole word. For more information, see TextSpan.

Returns

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

Remarks

COM Signature

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

Applies to