Skip to main content

relay_knowledge/code/
mod.rs

1//! Code repository indexing, parsing, identity, and source discovery boundaries.
2
3mod config_files;
4mod content_identity;
5mod error;
6pub(crate) mod feature_flags;
7mod generated_detection;
8mod identity;
9mod index;
10mod language_metadata;
11mod parser;
12mod registration;
13mod search;
14mod source;
15
16#[cfg(test)]
17#[path = "tests/source/declarations.rs"]
18mod source_declaration_tests;
19#[cfg(test)]
20#[path = "tests/source/filesystem.rs"]
21mod source_filesystem_tests;
22#[cfg(test)]
23#[path = "tests/source/layout.rs"]
24mod source_layout_tests;
25#[cfg(test)]
26#[path = "tests/source/submodule_followup.rs"]
27mod source_submodule_followup_tests;
28#[cfg(test)]
29#[path = "tests/source/submodule_regression.rs"]
30mod source_submodule_regression_tests;
31#[cfg(test)]
32#[path = "tests/source/submodule_review.rs"]
33mod source_submodule_review_tests;
34#[cfg(test)]
35#[path = "tests/source/submodule.rs"]
36mod source_submodule_tests;
37#[cfg(test)]
38#[path = "tests/fixtures.rs"]
39mod test_fixtures;
40#[cfg(test)]
41#[path = "mod_tests.rs"]
42mod tests;
43#[cfg(test)]
44#[path = "tests/source/worktree_overlay_review.rs"]
45mod worktree_overlay_review_tests;
46#[cfg(test)]
47#[path = "tests/source/worktree_overlay.rs"]
48mod worktree_overlay_tests;
49
50pub use error::CodeIndexError;
51pub use index::{
52    CodeIndexPlan, prepare_full_index_plan, prepare_full_index_plan_with_workspace_detection,
53};
54pub use index::{
55    build_index_snapshot, changed_paths_for_diff, changed_paths_for_diff_with_filters,
56    changed_paths_for_diff_with_path_filters, deleted_symbol_names_for_diff,
57};
58pub use registration::register_repository;
59pub use scope::{partition_changed_paths_for_selector, preview_repository_scope};
60pub use source::resolution::{
61    resolve_repository_ref, resolve_repository_ref_with_filters,
62    resolve_repository_ref_with_path_filters, resolve_repository_snapshot,
63    resolve_repository_snapshot_with_filters, resolve_repository_snapshot_with_path_filters,
64};
65
66#[cfg(test)]
67pub(crate) use changes::{
68    reset_tracked_entries_call_count_for_root, tracked_entries_call_count_for_root,
69};
70#[cfg(test)]
71pub(crate) use git::{
72    git_ls_tree_full_scan_call_count_for_root, git_show_call_count_for_root,
73    reset_git_ls_tree_full_scan_call_count_for_root, reset_git_show_call_count_for_root,
74};
75#[cfg(test)]
76pub(crate) use index::build_index_snapshot_with_base_commit;
77pub(crate) use index::changed_paths_for_filesystem_diff;
78pub(crate) use index::clean_worktree_overlay_hash;
79pub(crate) use index::compute_worktree_overlay_identity;
80#[cfg(test)]
81use index::impact_paths_from_changes;
82#[cfg(test)]
83pub(crate) use index::mutate_next_filesystem_full_snapshot_read;
84pub(crate) use index::{
85    build_index_snapshot_with_workspace_detection, repository_uses_filesystem_source,
86};
87pub(crate) use registration::REGISTRATION_LANGUAGE_FILTER_ERROR;
88pub(crate) use search::{
89    SOURCE_GREP_CANDIDATE_FILE_LIMIT, SourceGrepKind, SourceGrepMatch, SourceGrepOutcome,
90    SourceGrepRequest, source_grep_matches, source_grep_matches_from_worktree_overlay,
91};
92#[cfg(test)]
93use source::gitlink as source_gitlink;
94pub(crate) use source::roots as source_roots;
95use source::{changes, declarations as source_declarations, git, layout as scope};
96pub(crate) use source_declarations::{
97    SourceDeclarationMatch, safe_git_blob_path, simple_source_identifier,
98    source_declarations_for_identity, source_declarations_for_identity_from_worktree_overlay,
99    source_line_defines_identity,
100};
101
102use content_identity as ids;
103use ids::{stable_content_hash, stable_id};
104use index::snapshot;
105use index::snapshot::SnapshotBuild;
106use language_metadata as languages;
107#[cfg(test)]
108use parser::parse_indexed_file;
109
110#[cfg(test)]
111use {
112    crate::domain::{
113        CodeFileFingerprint, CodeIndexMode, CodeRepositoryRegistration, CodeRepositorySelector,
114    },
115    changes::{tracked_entries, worktree_changed_paths},
116    identity::resolve_reference_targets,
117    languages::language_id,
118    scope::{path_is_selected, path_scope_allows, path_scope_overlaps},
119    source::{RepositorySourceKind, source_snapshot_batch_bytes},
120};