ViewFilter.GetWordExtent Method
Returns the extent of the word or expression that contains the given location.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Syntax
'Declaration
Public Overridable Function GetWordExtent ( _
line As Integer, _
index As Integer, _
flags As UInteger, _
span As TextSpan() _
) As Integer
public virtual int GetWordExtent(
int line,
int index,
uint flags,
TextSpan[] span
)
public:
virtual int GetWordExtent(
int line,
int index,
unsigned int flags,
array<TextSpan>^ span
)
abstract GetWordExtent :
line:int *
index:int *
flags:uint32 *
span:TextSpan[] -> int
override GetWordExtent :
line:int *
index:int *
flags:uint32 *
span:TextSpan[] -> int
public function GetWordExtent(
line : int,
index : int,
flags : uint,
span : TextSpan[]
) : int
Parameters
- line
Type: System.Int32
[in] The line number to examine.
- index
Type: System.Int32
[in] The character offset on the line to examine.
- flags
Type: System.UInt32
[in] A combination of flags from the WORDEXTFLAGS enumeration.
- span
Type: array<Microsoft.VisualStudio.TextManager.Interop.TextSpan[]
[out] Returns a TextSpan object that contains the requested span.
Return Value
Type: System.Int32
If successful, returns S_OK. Returns S_FALSE if there is no identifier or expression at the specified location; otherwise, returns an error code.
Implements
IVsTextViewFilter.GetWordExtent(Int32, Int32, UInt32, array<TextSpan[])
Remarks
This method is called to get the extent of an identifier or an expression starting at a specific location. The location can be in the middle or at the end of the identifier or expression.
This method is an implementation of the GetWordExtent method on the IVsTextViewFilter interface.
The base method validates the parameters and forwards the call to the GetWordExtent on the Source object that was obtained in the ViewFilter constructor.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.