pub struct GraphBuilder { /* private fields */ }Expand description
Builds an ArborGraph from parsed code nodes.
Implementations§
Source§impl GraphBuilder
impl GraphBuilder
pub fn new() -> Self
Sourcepub fn add_nodes(&mut self, nodes: Vec<CodeNode>)
pub fn add_nodes(&mut self, nodes: Vec<CodeNode>)
Adds nodes from a parsed file to the graph.
This pass does two things:
- Adds real code entities (functions, classes, etc.) to the graph and symbol table
- Processes Import nodes to build the per-file import map
Call this for all files before calling build().
Sourcepub fn resolve_edges(&mut self)
pub fn resolve_edges(&mut self)
Resolves references into actual graph edges.
Each reference R from file F resolves through
SymbolTable::resolve_ref, which reports how it matched. That
quality becomes the edge’s confidence, so a downstream consumer can
distinguish a proven call from an educated guess instead of treating
every edge as fact.
Ambiguous references (several equally-plausible definitions) produce a
low-confidence edge to each candidate, capped at
[MAX_AMBIGUOUS_FANOUT]. Dropping them outright would silently hide
real call paths; emitting them unlabelled would overstate certainty.
References with no definition in the repository are dropped — they are external or stdlib symbols.
Sourcepub fn build(self) -> ArborGraph
pub fn build(self) -> ArborGraph
Finishes building and returns the graph.
Sourcepub fn build_without_resolve(self) -> ArborGraph
pub fn build_without_resolve(self) -> ArborGraph
Builds without resolving edges (for incremental updates).