Expand description
WS4 — the typed AST.
A thin, zero-cost typed view over the lossless CST (the rust-analyzer model). An
AST node just wraps a red GdNode of the matching SyntaxKind; accessors are
filtered child lookups. No data is copied. Because GdNode is a resolved node
(it carries the interner), text accessors are clean — Name::text() needs no extra
resolver argument.
Structs§
- Annotation
- Block
- Class
Body - Class
Name Decl - Const
Decl - Enum
Decl - Enum
Variant - Extends
Clause - Func
Decl - Inner
Class Decl - Name
- A declaration’s name (wraps the declared identifier).
- Param
- Param
List - Signal
Decl - Source
File - The whole file.
- TypeRef
- VarDecl
Enums§
- Decl
- Any top-level or class-body declaration — the unit
document_symbolsiterates.
Traits§
- AstNode
- A typed node: a checked view over a red node of one
SyntaxKind.
Functions§
- descendants
- A pre-order walk over every node in the tree (depth-first), for visitors that need to inspect all declarations/blocks (e.g. folding ranges).
- token_
at - The token (if any) at
offset, right-biased — the completion-context probe.