Skip to main content

gonzalo_graph/
lib.rs

1//! Code-graph capability layer: parse source into a symbol/reference graph
2//! and answer structural queries (`definitions`, `references_to`,
3//! `callers_of`). Rust is the first supported language (tree-sitter-rust);
4//! the model and store are language-agnostic so more grammars can be added.
5
6/// Version of the slice/graph extraction format.
7///
8/// Bumped whenever a change alters what the parser records for unchanged source
9/// — a new [`Reference`] field, a new edge rule, a grammar fix. An indexer that
10/// recorded a different version must do a full walk rather than an incremental
11/// one: carrying slices forward untouched is exactly what would otherwise leave
12/// a view permanently half-upgraded.
13///
14/// History: 1 = calls in macro arguments (#216); 2 = call-shape on references
15/// (#223); 3 = call-site qualifiers and definition owners (#248); 4 = functions
16/// named as values (#250); 5 = syntactic receiver types on method calls (#251);
17/// 6 = per-file imports (#252); 7 = Java/Kotlin imports (#260); 8 = JS/TS
18/// functions bound through a higher-order call, and object properties (#257);
19/// 9 = relative-import depth (#261); 10 = `.h` headers parsed as C++ (#266);
20/// 11 = C/C++ includes (#267); 12 = CommonJS `require` (#269); 13 = module-level
21/// attribution and its scope (#268).
22pub const EXTRACTION_VERSION: u32 = 13;
23
24pub mod assembly;
25pub mod builder;
26pub mod diff;
27pub mod model;
28pub mod resolve;
29pub mod store;
30
31pub use assembly::assemble;
32pub use builder::{Language, build, build_rust};
33pub use diff::{GraphDiff, diff};
34pub use model::{
35    CodeGraph, FileSummary, FromScope, Import, Located, Page, RankedSymbol, Ranking, RefKind,
36    Reference, Symbol, SymbolFilter, SymbolKind, ViewOverview,
37};
38pub use resolve::{
39    ImpactNode, ImpactReport, Resolution, ResolvedReference, resolve_references_to,
40    resolved_callers_of, resolved_impact,
41};
42pub use store::{GraphStore, InMemoryGraphStore};
43
44#[cfg(feature = "conformance")]
45pub mod conformance;