Skip to main content

Module item_tree

Module item_tree 

Source
Expand description

The item tree (Playbook §3.1): a signature-level view of one .gd file — its class_name, extends target, and class members (funcs/vars/consts/signals/enums/inner classes) — lowered from the CST without reading any function body.

This “no bodies” rule is the Phase-3 cache invariant: editing a function body must not change the item tree, so signature-derived data (and everything keyed on it) can be reused across body edits once salsa lands. To keep that promise the tree holds only plain owned data plus reparse-stable AstPtrs — never live CST nodes — so it is Eq and a body edit that doesn’t move a declaration produces an identical tree.

Structs§

AnnotationItem
A decorator annotation (@export, @onready, @tool, …) captured in the item tree. In the CST annotations are sibling nodes of the declaration they decorate (or, for class annotations like @tool, direct children of the file); the item tree lifts them onto the item so checks / accessors don’t re-walk siblings ad hoc.
ConstItem
A const member.
EnumItem
An enum member.
FuncItem
A func member (signature only — the body is lowered lazily by crate::body).
InnerClassItem
An inner class member: its name plus its own (recursively lowered) item tree.
ItemTree
The signature-level model of one file (or one inner class).
ParamItem
A parameter of a function or signal.
SignalItem
A signal member.
VarItem
A var member.

Enums§

ExtendsRef
An extends target. Phase 2 only resolves a bare engine-class ExtendsRef::Name; the dotted and script-path forms funnel through the Phase-3 seam to Ty::Unknown.
Member
One class member.

Functions§

has_annotation
Whether annotations contains one named exactly name.
item_tree
Lower a parsed file to its ItemTree (Playbook §3.1). Pure; reads no bodies.