hearth-graph
hearth-graph is a standalone Rust library for tree-sitter symbol extraction,
incremental symbol indexing, import analysis, and module-graph queries. It has
no global engine state and does not require Hearth's cache or transport crates.
Hosts own the language registry, source loading, cancellation, and concurrency
policy.
Capabilities
- injectable
LanguageRegistrywith an optional bundled grammar set - one-pass symbol and import analysis over tree-sitter parse trees
- incremental
SymbolIndexsearch and definition lookup - incremental
ModuleGraphdependency, reverse-dependency, and neighborhood queries withExactorApproximateguarantees - JavaScript/TypeScript resolution through
oxc_resolver - best-effort Rust module resolution
- cancellation-aware parallel index construction through a host-provided
SourceLoader
Quick start
use ;
let registry = bundled;
let mut parsers = new;
let symbols = extract_symbols;
assert!;
The default feature set includes the bundled languages, filesystem loader, and both resolver implementations. A host can disable defaults and inject its own grammar:
use ;
#
Features
| Feature | Enabled by default | Purpose |
|---|---|---|
bundled-languages |
yes | Bundled grammars, symbol queries, and supported import extractors |
fs |
yes | FsLoader implementation for direct filesystem indexing |
resolve-js |
yes | JavaScript and TypeScript resolution through oxc_resolver |
resolve-rust |
yes | Best-effort Rust module resolution |
resolve-rust deliberately reports partial completeness. Exact Rust resolution
requires Cargo target metadata and a module declaration tree that can model
cfg, #[path], macros, and inline modules.
Versioning and MSRV
The minimum supported Rust version is 1.95. The crate is currently in the
0.1 series; public APIs may evolve between minor releases. Pin an exact
version when integrating a compatibility facade.
The detailed cache adapter, freshness model, and graph guarantees used by the Hearth tools are documented in the Hearth architecture guide.
License
MIT