Skip to main content

matrixcode_core/tools/codegraph/
mod.rs

1//! CodeGraph integration for code symbol indexing and search.
2//!
3//! Integrates CodeGraph (https://github.com/colbymchenry/codegraph) for:
4//! - Symbol search across the codebase
5//! - Call graph analysis (callers/callees)
6//! - Impact analysis for code changes
7//! - Task context building for AI agents
8//!
9//! Uses SQLite direct access for fast queries, and CLI for index building.
10//!
11//! # Auto-sync
12//!
13//! CodeGraphWatcher provides automatic file watching and index synchronization.
14//! When source files change, it automatically runs `codegraph sync` to keep
15//! the index up-to-date.
16
17// Public API
18pub use self::ignore::WATCH_EXTENSIONS;
19pub use self::install::{ensure_codegraph, get_codegraph_path, is_codegraph_installed};
20pub use self::manager::CodeGraphManager;
21pub use self::project::find_project_root;
22pub use self::tools::{
23    CodeGraphCalleesTool, CodeGraphCallersTool, CodeGraphSearchTool, CodeGraphStatusTool,
24    CodeGraphSyncTool, codegraph_tools, codegraph_tools_if_installed,
25    codegraph_tools_with_auto_detect, should_inject_codegraph_tools,
26};
27pub use self::types::{CodeGraphEnv, Edge, FileInfo, IndexStatus, Node, PendingChanges};
28pub use self::watcher::{CodeGraphWatcher, WatcherHandle};
29
30// Internal modules
31mod git;
32mod ignore;
33mod install;
34mod manager;
35mod project;
36mod tools;
37mod types;
38mod watcher;