Add fuzzy_nucleo crate for order independent file finder search#51164
Add fuzzy_nucleo crate for order independent file finder search#5116411happy wants to merge 4 commits intozed-industries:mainfrom
Conversation
Signed-off-by: Bhuminjay <[email protected]>
Signed-off-by: Bhuminjay <[email protected]>
Signed-off-by: Bhuminjay <[email protected]>
Signed-off-by: Bhuminjay <[email protected]>
| .filter(|path_match| { | ||
| if let Some(filename) = path_match.path.file_name() { | ||
| let filename_start = path_match.path.as_unix_str().len() - filename.len(); | ||
| path_match | ||
| .positions | ||
| .iter() | ||
| .any(|&pos| pos >= filename_start) | ||
| } else { | ||
| true | ||
| } | ||
| }) |
There was a problem hiding this comment.
The earlier fuzzy matcher scored directory matches differntly however for example nucleo scores colab_ui against collab_ui/first.rs high, while working a previous test was failing (test_history_items_vs_very_good_external_match) so filtering out matches where query does not match filename.
| if let Some(score) = pattern.indices(haystack, matcher, &mut indices) { | ||
| let length_penalty = candidate_buf.len() as f64 * 0.001; |
There was a problem hiding this comment.
added a length penalty as nucleo was scoring maaa.rs & moo.rs same (in this case when I debugged it was 80 for both ) causing some test failures ex.(test_keep_opened_file_on_top_of_search_results_and_select_next_one)
|
hey @11happy I had a quick look and this looks pretty much great. I've set some time apart for a thorough review early next week but I expect we can merge this soon thereafter. Thank you so much for this work, I've wanted this for quiet a while! |
Closes #14428
Before you mark this PR as ready for review, make sure that you have:
screencast.mp4
Release Notes:
fuzzy_nucleocrate that implements order independent pathmatching using the
nucleolibrary. currently integrated for file finder.