Source.GetTokenInfo Method (Int32, Int32)


Gets information about the token at the specified position.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

public virtual TokenInfo GetTokenInfo(
	int line,
	int col


Type: System.Int32

The number of the line containing the token to examine.

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

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.


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

Return to top