Repository navigation
perf(fuzzy): match only the previous results when the query gets longer - #914
dmtrKovalenko wants to merge 2 commits into
Conversation
When a plain-text query extends the previous query and the typo budget stays the same, fuzzy file search matches only the files that the previous query matched. Adding, restoring or replacing files clears the cached match set.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🔇 Additional comments (3)
crates/fff-core/src/score.rs (1)
160-203: LGTM!Also applies to: 685-757, 1199-1264, 1452-1454, 1484-1527, 1529-1574, 2029-2029, 2108-2108, 2350-2350, 2438-2439, 2549-2549, 2600-2600
crates/fff-core/src/file_picker.rs (1)
41-43: LGTM!Also applies to: 611-612, 725-725, 937-937, 1042-1042, 1152-1161, 1533-1533, 1780-1780, 1816-1816
crates/fff-core/src/score.rs-1528-1528 (1)
1528-1528: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.The "Spell Check with Typos" check flags
"omnibx_veiw".The typo is on purpose and the test needs it. The check reports
veiw, so it will keep firing. Exclude this word in the typos config, or build the string so the checker does not see it (for example,concat!("omnibx_v", "eiw")).Source: Linters/SAST tools
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ba059de0-006f-4a8d-ab3f-ba1caabbeccd
📒 Files selected for processing (2)
crates/fff-core/src/file_picker.rscrates/fff-core/src/score.rs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Fuzzy file search keeps the set of files that the last plain-text query matched. When the next query extends that query and the typo budget (
len / 4, clamped to 2..=6) stays the same, the search matches only that set instead of all files. Adding, restoring or replacing files clears the set.A path that matches a needle within
ktypos also matches every prefix of that needle withinktypos, so the reduced set gives the same results. Scoring, filename fallback, sorting and pagination run unchanged on the matched files.max_threads = 4mainTyping = each of 60 file names typed one character at a time with a 40 ms gap. Single queries do not change, because they have no previous query to reuse.
Note
The cache applies only to plain-text queries without constraints. Multi-part queries (
dir name) and queries with constraints (*.rs,status:modified) use the full search as before.Correctness
incremental_typing_matches_full_search: 40k paths, typing with typos, backspace and a typo budget change. Each keystroke must give the same items, order and scores as a full search.make test-rustandmake lint-rustpass.Cache invalidation
commit_new_sync/collect_filesget_file_mut(public)Summary by CodeRabbit