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::types::{Node, Edge, IndexStatus, PendingChanges, FileInfo, CodeGraphEnv};
19pub use self::manager::CodeGraphManager;
20pub use self::watcher::{CodeGraphWatcher, WatcherHandle};
21pub use self::ignore::WATCH_EXTENSIONS;
22pub use self::tools::{
23    codegraph_tools, codegraph_tools_with_auto_detect, codegraph_tools_if_installed,
24    should_inject_codegraph_tools,
25    CodeGraphSearchTool, CodeGraphCallersTool, CodeGraphCalleesTool, 
26    CodeGraphStatusTool, CodeGraphSyncTool,
27};
28pub use self::install::{get_codegraph_path, ensure_codegraph, is_codegraph_installed};
29pub use self::project::find_project_root;
30
31// Internal modules
32mod types;
33mod manager;
34mod watcher;
35mod tools;
36mod install;
37mod project;
38mod git;
39mod ignore;