Skip to main content

relay_knowledge/code/
mod.rs

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