Skip to main content

Crate gdscript_base

Crate gdscript_base 

Source
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.)
CodeAction
A code action / quick-fix: a titled, optionally-kinded SourceChange.
CompletionItem
A by-name completion suggestion.
Diagnostic
A diagnostic with a byte range, a stable machine code, a severity, and a message.
DocumentSymbol
A (possibly nested) symbol in a document’s outline.
FileEdit
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.
FilePosition
A (file, byte offset) cursor position.
FileRange
A (file, range) pair — the atom of cross-file navigation results.
FoldRange
A foldable range.
HoverResult
The result of a hover query: an inferred type / signature label plus engine docs.
InlayHint
An inline hint rendered at a byte offset (e.g. the : int the engine LSP omits).
LineCol
A 0-based (line, column) position. col is a byte offset within the line.
LineIndex
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.
ParamInfo
One parameter within a SignatureInfo.
Reference
One reference to a symbol (find-references result), including its declaration.
SemanticToken
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 of semantic_token_modifier flags.
SignatureHelp
The result of a signature-help query at a call site.
SignatureInfo
One signature shown in signature help (GDScript has no overloads, so usually one).
SourceChange
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.
TextEdit
A single text edit: replace range with new_text.
TextRange
A half-open byte range [start, end) into a file’s UTF-8 source.

Enums§

CompletionKind
The kind of a completion item.
DiagnosticSource
What analysis layer produced a diagnostic — lets clients group/filter parse vs. type diagnostics without parsing the code.
FoldKind
What a fold range corresponds to.
InlayHintKind
What an InlayHint represents.
ReferenceKind
Why a token is a reference (rust-analyzer’s ReferenceCategory, trimmed).
RenameError
Why a rename was refused — the “correct or it refuses” contract. Never a partial edit.
SemanticTokenType
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.
SymbolKind
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 BBCode already converted at codegen time).