Skip to main content

Crate gdscript_ide

Crate gdscript_ide 

Source
Expand description

gdscript-ide — the public, engine-/protocol-neutral analysis API.

Modeled on rust-analyzer’s ide::AnalysisHost / ide::Analysis (plans/01-ARCHITECTURE.md §2). AnalysisHost is the single mutable owner of the input world; Analysis is a cheap, cloneable, Send snapshot whose queries take byte offsets and return plain serde result structs from gdscript-base — never lsp-types. Each client (LSP server, the guitkx adapter, the CLI, the WASM playground) maps these POD results to its own protocol.

Phase 3 (M0) swaps the engine behind these types from a plain VFS map to a salsa query graph in gdscript_db: the input world is now FileText salsa inputs, mutated through apply_change; Analysis is a cloned database handle (salsa handles are Clone + Send, replacing the old Arc<map> snapshot). Cancellation is now real — a concurrent apply_change cancels in-flight reads on outstanding handles, which unwind into Err(Cancelled) at the query boundary (see [catch]). The public API shape is unchanged. The crate stays wasm32-safe (CI guards this).

Structs§

Analysis
An immutable snapshot of the world — a cloned salsa handle. Every query is Cancellable: a concurrent apply_change cancels in-flight reads, which the client re-issues against the fresh snapshot.
AnalysisHost
The single mutable owner of analysis state — one per project/workspace.
Change
A batch of input changes. None text removes the file.

Enums§

WarningOverride
Re-exported so clients can set the warning-strictness override without depending on gdscript-db directly. See AnalysisHost::set_warning_override. The database trait gdscript-hir / gdscript-ide depend on. #[salsa::db] on the trait makes it a salsa supertrait, so any &dyn Db upcasts to &dyn salsa::Database and every #[salsa::tracked] free function downstream can take db: &dyn Db. A host/CLI-level override of the warning-strictness baseline type_diagnostics resolves against (regardless of project.godot presence). A plain (non-salsa) per-session policy knob: it is read only inside the non-tracked type_diagnostics, so it never enters the salsa query graph and cannot break the W1 firewall (a warning-level change must never re-run inference).