Compartir a través de


Source.GetTokenInfo Method

Gets information about the token at the specified position.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.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)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'Declaration
Public Overridable Function GetTokenInfo ( _
    line As Integer, _
    col As Integer _
) As TokenInfo
public virtual TokenInfo GetTokenInfo(
    int line,
    int col
)
public:
virtual TokenInfo^ GetTokenInfo(
    int line, 
    int col
)
abstract GetTokenInfo : 
        line:int * 
        col:int -> TokenInfo  
override GetTokenInfo : 
        line:int * 
        col:int -> TokenInfo
public function GetTokenInfo(
    line : int, 
    col : int
) : TokenInfo

Parameters

  • line
    Type: Int32

    The number of the line containing the token to examine.

  • col
    Type: Int32

    The character offset in the line to the token to examine.

Return Value

Type: Microsoft.VisualStudio.Package.TokenInfo
A TokenInfo object containing information about the current token.

Remarks

This method calls the colorizer's GetLineInfo method to tokenize the current line, and then calls

GetTokenInfoto get the token information at the character position on the line.

Warning

This method requires a valid Colorizer object and associated IScanner object to be passed to the Source class constructor.

.NET Framework Security

See Also

Reference

Source Class

Microsoft.VisualStudio.Package Namespace