Skip to main content

Module ast

Module ast 

Source
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
ClassBody
ClassNameDecl
ConstDecl
EnumDecl
EnumVariant
ExtendsClause
FuncDecl
InnerClassDecl
Name
A declaration’s name (wraps the declared identifier).
Param
ParamList
SignalDecl
SourceFile
The whole file.
TypeRef
VarDecl

Enums§

Decl
Any top-level or class-body declaration — the unit document_symbols iterates.

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.