greppy/trace/mod.rs
1//! Greppy Trace - Complete Codebase Invocation Mapping
2//!
3//! This module provides semantic code indexing and traversal capabilities:
4//! - Symbol definitions (functions, classes, methods)
5//! - Call graph edges
6//! - Reference tracking (reads, writes, type annotations)
7//! - Scope tree for context
8//! - Token index for every identifier
9//!
10//! @module trace
11
12pub mod builder;
13pub mod context;
14pub mod extract;
15pub mod index;
16pub mod output;
17pub mod snapshots;
18pub mod storage;
19pub mod traverse;
20pub mod types;
21
22// =============================================================================
23// RE-EXPORTS: Core Data Structures (types.rs)
24// =============================================================================
25
26pub use types::{
27 Edge, RefKind, Reference, Scope, ScopeKind, Symbol, SymbolFlags, SymbolKind, Token, TokenKind,
28 NO_PARENT_SCOPE,
29};
30
31// =============================================================================
32// RE-EXPORTS: Index (index.rs)
33// =============================================================================
34
35pub use index::{IndexStats, SemanticIndex, StringTable};
36
37// =============================================================================
38// RE-EXPORTS: Storage (storage.rs)
39// =============================================================================
40
41pub use storage::{
42 load_index, load_index_streaming, save_index, trace_index_exists, trace_index_path,
43};
44
45// =============================================================================
46// RE-EXPORTS: Traversal (traverse.rs)
47// =============================================================================
48
49pub use traverse::{
50 find_call_refs, find_dead_symbols, find_read_refs, find_refs, find_refs_of_kind,
51 find_write_refs, format_call_chain, format_invocation_path, trace_symbol, trace_symbol_by_name,
52 InvocationPath as TraverseInvocationPath, ReferenceContext, TraceResult as TraverseTraceResult,
53};
54
55// =============================================================================
56// RE-EXPORTS: Extraction (extract/)
57// =============================================================================
58
59pub use extract::{
60 detect_language, extract_file, is_treesitter_supported, ExtractedCall, ExtractedData,
61 ExtractedRef, ExtractedScope, ExtractedSymbol, ExtractedToken, ExtractionMethod,
62};
63
64// =============================================================================
65// RE-EXPORTS: Output (output/)
66// =============================================================================
67
68pub use output::{
69 create_formatter, AsciiFormatter, ChainStep, DeadCodeResult, DeadSymbol, FlowAction,
70 FlowResult, FlowStep, ImpactResult, InvocationPath, JsonFormatter, OutputFormat,
71 PlainFormatter, ReferenceInfo, ReferenceKind, RefsResult, RiskLevel, TraceFormatter,
72 TraceResult,
73};
74
75// =============================================================================
76// RE-EXPORTS: Builder (builder.rs)
77// =============================================================================
78
79pub use builder::{build_and_save_index, build_index_parallel, BuildStats, SemanticIndexBuilder};
80
81// =============================================================================
82// RE-EXPORTS: Context (context.rs)
83// =============================================================================
84
85pub use context::{CacheStats, CodeContext, ContextBuilder, FileCache};
86
87// =============================================================================
88// RE-EXPORTS: Snapshots (snapshots.rs)
89// =============================================================================
90
91pub use snapshots::{
92 cleanup_snapshots, compare_snapshots, create_snapshot, delete_snapshot, latest_snapshot,
93 list_snapshots, load_snapshot, snapshots_dir, FileMetrics, Snapshot, SnapshotComparison,
94 SnapshotDiff, SnapshotList, SnapshotMetrics, SnapshotSummary,
95};