다음을 통해 공유


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

‘선언
Public Overridable Function GetWordExtent ( _
    line As Integer, _
    index As Integer, _
    flags As UInteger, _
    span As TextSpan() _
) As Integer
‘사용 방법
Dim instance As ViewFilter
Dim line As Integer
Dim index As Integer
Dim flags As UInteger
Dim span As TextSpan()
Dim returnValue As Integer

returnValue = instance.GetWordExtent(line, _
    index, flags, span)
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

  • index
    Type: System.Int32
    [in] The character offset on the line to examine.

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

See Also

Reference

ViewFilter Class

ViewFilter Members

Microsoft.VisualStudio.Package Namespace