Expand description
Code node representation.
A CodeNode is our abstraction over raw AST nodes. It captures the semantically meaningful parts of code: what it is, where it lives, and enough metadata to be useful for graph construction.
Structs§
- Code
Node - A code entity extracted from source.
Enums§
- Node
Kind - The kind of code entity this node represents.
- Type
Relation Kind - A type relationship stored on a node until the graph builder resolves it.
- Visibility
- Visibility of a code entity.
Constants§
- EXTENDS_
REF_ PREFIX - Prefix on
CodeNode::referencesfor a superclass name. - FIELD_
REF_ PREFIX - Prefix for a field’s type stored on a struct node:
field:draft:Draft. - IMPLEMENTS_
REF_ PREFIX - Prefix on
CodeNode::referencesfor an implemented interface or trait. - RETURNS_
REF_ PREFIX - Prefix for the type a function returns, stored on its node:
returns:PreparedDraftfor-> Option<mac::PreparedDraft>. Stripped like a field type, withSelfalready replaced by the impl type.
Functions§
- clean_
type_ name - Strips pointers, references, and generic arguments from a type name.
- field_
ref - Encodes a struct field’s type as a reference.
- field_
type_ ref - Splits a
field:name:Typereference into the field name and its type. - return_
type_ ref - The return type recorded by a
returns:Typereference. - returns_
ref - Encodes a function’s (stripped) return type as a reference.
- type_
relation_ ref - Splits an
extends:/implements:reference into its kind and type name. - typed_
receiver - Splits a typed receiver reference into the method name and the receiver’s
type path (
TypeorType.field.field). - typed_
receiver_ ref - Encodes a method call whose receiver’s type is known from the code:
.run_started@Draft, or.run_started@AppState.draftfor a call on a field of a value of typeAppState.