Share via


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.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.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: Int32

    [in] The line number to examine.

  • index
    Type: Int32

    [in] The character offset on the line to examine.

  • flags
    Type: UInt32

    [in] A combination of flags from the WORDEXTFLAGS enumeration.

Return Value

Type: 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

See Also

Reference

ViewFilter Class

Microsoft.VisualStudio.Package Namespace