Skip to main content

Module def

Module def 

Source
Expand description

Canonical symbol identity + cursor classification (Playbook §3.M5) — the basis of cross-file navigation (find-references, rename, goto-definition).

GodotDef is the analyzer’s analogue of rust-analyzer’s Definition: a stable identity for a renameable/findable symbol, keyed on declaration site (file + name / body location), never on the name string alone. classify is the inverse of inference — it does the same local → member → inherited → global → autoload → engine lookup crate::infer does, but returns the declaration identity instead of the type. Find-references resolves the cursor to a GodotDef, then keeps only other tokens that classify to the same GodotDef (resolve, don’t string-match), so two unrelated is, A.update vs B.update, or a local shadowing a member are distinct by construction.

GDScript forbids two same-named members in one class, so a GodotDef::Member is identified by (owner_file, name) alone — no member kind in the identity (which keeps decl-site and reference-site classification consistent; the kind is recovered from the item tree for display).

Structs§

NodePathTarget
A $Path/%Unique/get_node("…") resolved to its scene-node declaration — for go-to-definition into the owning .tscn (the [node …] line). The inverse of M1’s node-path typing.

Enums§

GodotDef
The canonical identity of a findable / renameable symbol. Equality is on identity, not the name string (rust-analyzer’s Definition).

Functions§

classify
Classify the symbol the cursor (pos) sits on — the single entry point find-references and goto-definition share. None for a non-identifier token, or a reference whose target cannot be resolved (the seam — we never guess an identity).
node_path_target
If the cursor sits on a node-path expression ($Path/%Unique/get_node("…")) that resolves against the owning scene, the target node’s declaration in the .tscn. None otherwise.