Expand description
gdscript-base — foundational POD types shared across the gdscript-analyzer.
The lowest layer of the crate stack (plans/01-ARCHITECTURE.md §1). It holds the
engine-/protocol-neutral, serde-serializable result structs every client maps to
its own protocol, plus byte-offset position types and a LineIndex for the
byte↔(line, column) and byte↔UTF-16 conversions LSP clients need.
All offsets are byte offsets into a file’s UTF-8 source. No logic beyond the
conversions lives here. The crate is wasm32-safe (no std::fs, clocks, threads).
Modules§
- semantic_
token_ modifier - Bit flags for
SemanticToken::modifiers(the LSP standard modifier subset we emit).
Structs§
- Cancelled
- A read query was cancelled by a concurrent change. (Phase 1 never actually cancels, but the type is on the API surface so the Phase 3 salsa swap is source-compatible.)
- Code
Action - A code action / quick-fix: a titled, optionally-kinded
SourceChange. - Completion
Item - A by-name completion suggestion.
- Diagnostic
- A diagnostic with a byte range, a stable machine code, a severity, and a message.
- Document
Symbol - A (possibly nested) symbol in a document’s outline.
- File
Edit - The edits to apply to one file (non-overlapping; the client sorts and applies them).
- FileId
- An opaque file handle. The host owns the
FileId→ text mapping; the library never reads paths. - File
Position - A
(file, byte offset)cursor position. - File
Range - A (file, range) pair — the atom of cross-file navigation results.
- Fold
Range - A foldable range.
- Hover
Result - The result of a hover query: an inferred type / signature label plus engine docs.
- Inlay
Hint - An inline hint rendered at a byte offset (e.g. the
: intthe engine LSP omits). - LineCol
- A 0-based
(line, column)position.colis a byte offset within the line. - Line
Index - Maps byte offsets to/from
(line, column)and UTF-16 columns. - NavTarget
- A navigation target (goto-definition / -declaration). Phase 2 only ever points within the same file; cross-file targets arrive in Phase 3.
- Param
Info - One parameter within a
SignatureInfo. - Reference
- One reference to a symbol (find-references result), including its declaration.
- Semantic
Token - A semantic-highlighting token: a source range classified by its contextual/resolved role. Drives
textDocument/semanticTokens— intelligence a grammar can’t produce. Modifiers are a bitset ofsemantic_token_modifierflags. - Signature
Help - The result of a signature-help query at a call site.
- Signature
Info - One signature shown in signature help (GDScript has no overloads, so usually one).
- Source
Change - A set of edits across one or more files (a cross-file rename, a quick-fix). Phase 3’s rename
spans files, so this is multi-file; a single-file change is just one
FileEdit. - Text
Edit - A single text edit: replace
rangewithnew_text. - Text
Range - A half-open byte range
[start, end)into a file’s UTF-8 source.
Enums§
- Completion
Kind - The kind of a completion item.
- Diagnostic
Source - What analysis layer produced a diagnostic — lets clients group/filter parse vs. type
diagnostics without parsing the
code. - Fold
Kind - What a fold range corresponds to.
- Inlay
Hint Kind - What an
InlayHintrepresents. - Reference
Kind - Why a token is a reference (rust-analyzer’s
ReferenceCategory, trimmed). - Rename
Error - Why a rename was refused — the “correct or it refuses” contract. Never a partial edit.
- Semantic
Token Type - The semantic role of a
SemanticToken— a GDScript-named subset of the LSP standard token types. Richer than a TextMate grammar: it distinguishes a type from a variable, a parameter from a local, a member from a global, a declaration from a use. - Severity
- Diagnostic severity.
- Symbol
Kind - The kind of a document symbol (a subset of LSP
SymbolKind, named for GDScript).
Type Aliases§
- Cancellable
- The result of a cancellable read query.
- Markdown
- Documentation rendered as Markdown (engine
BBCodealready converted at codegen time).