Skip to main content

Module semantic_tokens

Module semantic_tokens 

Source

Constants§

MOD_DECLARATION
MOD_DEFAULT_LIBRARY
MOD_MODIFICATION
MOD_READONLY
TOKEN_MODIFIERS
TOKEN_TYPES
Our semantic token types, registered with the client. The legend is APPEND-ONLY — indices are a wire contract with client themes (pinned by tests/locks.rs).
TYPE_COMMENT
TYPE_ENUM_MEMBER
TYPE_FUNCTION
TYPE_KEYWORD
TYPE_MODIFIER
TYPE_NAMESPACE
TYPE_NUMBER
TYPE_OPERATOR
TYPE_PARAMETER
TYPE_PROPERTY
TYPE_STRING
TYPE_TYPE
TYPE_VARIABLE

Functions§

classify_token
Map a TokenType to a semantic token type index and modifier bitset.
encode_document_tokens
Encode a document’s tokens with the full resolution overlay.
encode_document_tokens_in_range
Resolution-aware encoding restricted to tokens overlapping a byte range. The first emitted token stays absolute from the document start, exactly as the LSP range response requires.
encode_tokens
Convert a token stream to LSP semantic tokens (delta-encoded) using the base part-of-speech layer only. encode_document_tokens is the resolution-aware entry point.
find_mutation_targets
Span starts of tokens that a statement WRITES: Set <x> to … / Set … at <k> to …-style targets take the identifier nearest the write (the last one before to, or before at when a keyed write follows), Increase/Decrease <x>, Push/Add/Append … to <x>, Remove/Pop … from <x>.
legend
semantic_token_edits
The minimal single-splice edit list turning prev into next.
semantic_type_for
The semantic token type an identifier gets once resolution names its kind. Wildcard-free: a new DefinitionKind must decide its color here.