Documentation
¶
Overview ¶
Package semtok is the semantic-token vocabulary a classified document is written in: the LSP-standardized classes and modifiers, the lexical half of the classification (keywords, comments and literals, which need no symbol table), and the relative UTF-16 encoding the Language Server Protocol transmits them in.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Class ¶
type Class int
Class is the kind of a semantic token. Its String is the LSP token type name.
const ( ClassNamespace Class = iota ClassClass ClassEnum ClassInterface ClassStruct ClassParameter ClassVariable ClassProperty ClassEnumMember ClassFunction ClassMethod ClassKeyword ClassComment ClassString ClassNumber )
The classes this package emits, in legend order.
type Modifier ¶
type Modifier uint32
Modifier is a bitset of token modifiers. Bit i is the modifier at index i of Modifiers.
The modifiers this package emits, in legend order.
type Position ¶
Position is a zero-based line and character, the shape the LSP reports in; the character counts UTF-16 code units.
type Token ¶
Token is one classified span of source text.
func Lexical ¶
Lexical classifies keywords, comments and literals, read from the same token stream the parser uses rather than recognized again, in a file of the given kind: the tokens a document carries with no symbol table at all. A word the file's grammar does not reserve reaches here as the name it is, as the parser reads it (parser.Scanner).