Documentation
¶
Overview ¶
The semtok package provides an encoder for LSP's semantic tokens.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TokenModifiers = []Modifier{ ModDefinition, ModReadonly, ModDefaultLibrary, ModArray, ModBool, ModChan, ModFormat, ModInterface, ModMap, ModNumber, ModPointer, ModSignature, ModSlice, ModString, ModStruct, }
TokenModifiers is a slice of modifiers gopls will return as its server capabilities.
View Source
var TokenTypes = []Type{ TokNamespace, TokType, TokTypeParam, TokParameter, TokVariable, TokFunction, TokMethod, TokMacro, TokKeyword, TokComment, TokString, TokNumber, TokOperator, TokLabel, }
TokenTypes is a slice of types gopls will return as its server capabilities.
Functions ¶
Types ¶
type Modifier ¶ added in v0.17.0
type Modifier string
const ( // LSP 3.18 standard modifiers // As with TokenTypes, clients get only the modifiers they request. // // The section below defines a subset of modifiers in standard modifiers // that gopls understand. ModDefaultLibrary Modifier = "defaultLibrary" // for predeclared symbols ModDefinition Modifier = "definition" // for the declaring identifier of a symbol ModReadonly Modifier = "readonly" // for constants (TokVariable) // non-standard modifiers // // Since the type of a symbol is orthogonal to its kind, // (e.g. a variable can have function type), // we use modifiers for the top-level type constructor. ModArray Modifier = "array" ModBool Modifier = "bool" ModChan Modifier = "chan" ModFormat Modifier = "format" // for format string directives such as "%s" ModInterface Modifier = "interface" ModMap Modifier = "map" ModNumber Modifier = "number" ModPointer Modifier = "pointer" ModSignature Modifier = "signature" // for function types ModSlice Modifier = "slice" ModString Modifier = "string" ModStruct Modifier = "struct" )
type Type ¶ added in v0.18.0
type Type string
const ( // These are the tokens defined by LSP 3.18, but a client is // free to send its own set; any tokens that the server emits // that are not in this set are simply not encoded in the bitfield. TokComment Type = "comment" // for a comment TokFunction Type = "function" // for a function TokKeyword Type = "keyword" // for a keyword TokLabel Type = "label" // for a control label (LSP 3.18) TokMacro Type = "macro" // for text/template tokens TokMethod Type = "method" // for a method TokNamespace Type = "namespace" // for an imported package name TokNumber Type = "number" // for a numeric literal TokOperator Type = "operator" // for an operator TokParameter Type = "parameter" // for a parameter variable TokString Type = "string" // for a string literal TokType Type = "type" // for a type name (plus other uses) TokTypeParam Type = "typeParameter" // for a type parameter TokVariable Type = "variable" // for a var or const )
Click to show internal directories.
Click to hide internal directories.