Expand description
whycodes-index — fast, gitignore-aware workspace file index.
One background scan of the project roots feeds every consumer:
- TUI file picker — fuzzy path queries (
@file, Ctrl+Space) served by a residentnucleoengine; keystroke queries never touch the disk. - File tools —
glob/list/grepenumerate the in-memory store instead of re-walking the tree on every tool call. Grep also consults a resident content-trigram overlay so regex confirm only opens files that could contain a required literal.
The walk honours .gitignore / .ignore (via the ignore crate, the
same engine ripgrep uses) plus the shared pruning policy. After the
initial scan a notify watcher streams debounced deltas so the index
stays warm as files are created, edited and deleted during a session.
let index = whycodes_index::WorkspaceIndex::start(vec![".".into()]);
let hits = index.query("main.rs", 20);Re-exports§
pub use walk::WalkEntry;pub use walk::WalkStats;pub use walk::walk_root;pub use walk::walk_root_limited;
Modules§
- policy
- Unified tree-pruning policy for project scans.
- walk
ignore-crate walker: gitignore-aware, policy-pruned, capped, cancellable.
Structs§
- Content
Index - Per-root overlay: relative path → unique sorted trigrams.
- Entry
- One indexed entry.
- File
Match - One fuzzy match returned to the UI.
- Index
Options - Options for
WorkspaceIndex::start_with. - Index
Store - Per-root view of the entry store.
- Workspace
Index - Resident workspace file index. Clone-handle via
Arc.
Enums§
- Scan
Status - Scan progress reported by
WorkspaceIndex::status.
Constants§
- DEFAULT_
MAX_ ENTRIES - Default cap on indexed entries per root.
- MAX_
INDEX_ BYTES - Files larger than this are skipped (grep also refuses to search them).
- TRIGRAM_
LEN - Bytes of an overlapping trigram.
Functions§
- extract_
trigrams - Unique sorted overlapping 3-byte trigrams. Empty when
bytesis shorter thanTRIGRAM_LEN. - pack_
trigram - Pack three bytes into a
u32key. - required_
trigrams - Required trigrams for a grep pattern, or
Nonewhen the overlay must not prune (regex, too short, or Unicode case-fold).