1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! grove-core — the structural code-intelligence library behind the grove CLI
//! and MCP server.
//!
//! This crate hosts the tree-sitter AST engine, the grammar registry, grammar
//! fetching, and source ingest. It is `clap`-free: command-line concerns live in
//! the `grove` binary crate, which consumes this library via `grove_core::`.
//!
//! # Overview
//!
//! The consumer-facing surface is the [`ops`] module — a small set of structural
//! queries that work for **any** registered language (grammars load from the
//! [`registry`] as wasm, so nothing is compiled in):
//!
//! - [`ops::outline`] — the definitions in one file (its symbol skeleton).
//! - [`ops::symbols`] — find symbols across a directory, gitignore-aware.
//! - [`ops::source`] — the full source text of one symbol, by id or name.
//! - [`ops::check`] — the syntactic defects (ERROR / MISSING) in one file.
//! - [`ops::callers`] — every reference to a name, with its enclosing function.
//! - [`ops::map`] — a directory's definitions and their outgoing references.
//! - [`ops::definition`] / [`ops::definition_at`] — go-to-def by name or use site.
//!
//! [`init::provision_project`] is the grammar-provisioning entry point used by
//! `grove init`. The lower-level [`engine`], [`fetch`], and [`ingest`] modules are
//! public for hosts that need deeper access.
//!
//! # Example
//!
//! ```no_run
//! use std::path::Path;
//! use grove_core::ops;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Every definition under `src/`, gitignore-aware.
//! let symbols = ops::symbols(Path::new("src"), None, None, false, false)?;
//! for s in &symbols {
//! println!("{} {} — {}:{}", s.kind, s.name, s.file, s.line);
//! }
//! # Ok(())
//! # }
//! ```
// ---- Curated public surface ----
//
// Root re-exports so consumers can name the common return types and entry points
// directly (e.g. `grove_core::Symbol`) instead of reaching through module paths.
// The full module set above stays public for callers that need deeper access;
// internal helpers (`Loaded`, `CapturedQuery`, `Index`, `Sources`, `Spec`,
// `Catalog`, …) remain private to their modules and are not re-exported.
/// Core symbol/defect types extracted by the [`engine`].
pub use ;
/// Return types of the [`ops`] structural queries.
pub use ;
/// The grammar-provisioning entry point behind `grove init` (see [`init`]).
pub use provision_project;