fix(windows): directorySearch returns 0 results on Windows#394
Conversation
| } | ||
|
|
||
| /// Return dirs ranked by frecency only (no fuzzy query). | ||
| fn score_dirs_by_frecency<'a>( |
There was a problem hiding this comment.
wooooow this is so bad how did I leave this function
e9ff0f6 to
1391f73
Compare
1391f73 to
aa1a249
Compare
* feat: add pi extension for FFF file search Add @ff-labs/pi-fff package providing pi coding agent integration: - Overrides built-in find/grep tools with FFF-powered versions - Adds multi_grep tool for SIMD-accelerated multi-pattern search - Replaces @-mention autocomplete with FFF frecency-ranked suggestions - Commands: /fff-health, /fff-rescan, /fff-mode (with immediate switch) - Streamlined implementation: 26% code reduction (800→590 lines) Published as pi package: npm:@ff-labs/pi-fff * docs: fix install instructions - Remove git install option (doesn't work for monorepo subfolders) - Remove config file from mode precedence (no longer used) - Keep npm as only recommended install method * feat: add root pi manifest for git installs Add pi configuration to root package.json pointing to packages/pi-fff. This enables: pi install git:github.com/dmtrKovalenko/fff.nvim The root stays private (not published to npm), but pi can now discover the extension from the git repo structure. * docs: add git install instructions Now that root package.json has pi manifest, git installs work: pi install git:github.com/dmtrKovalenko/fff.nvim * fix: address PR review feedback - Add config file persistence for /fff-mode (fixes 'persist' claim) - Add readConfigMode() and writeConfigMode() helpers - Use applyEditorMode() in /fff-mode command (DRY) - Add publishConfig.access: 'public' for npm publishing - Fix @types/node to ^22.0.0 (align with repo) - Remove ignoreCase parameter (FFF doesn't support force case-insensitive) - Run Biome formatter (fix tab indentation) * update toolnames and add to release pipeline * do not override default tools * Make an option to override the default tools * fix: macos tests * better toolnames mangement --------- Co-authored-by: Dmitriy Kovalenko <dmtr.kovalenko@outlook.com>
|
I have added some fixes that I think eliminates the need for the normalization could you please pull and check if this is actualy resolves and issue on your end |
I will check this to test in a moment, but in my end it is working with my fixes already as intended |
|
I don't like the normalization of paths. I want to avoid that as much as possible |
|
I pulled the latest main and tested on Windows: grep works, but directorySearch still returns 0 items on Windows. The issue persists without the path normalization fix. The root cause is that |
|
Wait but I got rid of all rfind / no? |
|
Tested commit 2c837c8 on Windows — it works! 🎉 The rfind fix resolves the issue. I'll remove my path normalization commits since they're no longer needed. Thanks for the quick fix! |
|
Closing — the fix in commit 2c837c8 works. Thanks for resolving this upstream! |
|
Wait but we need to make sure it's merged :D |
Problem
On Windows,
directorySearchreturns 0 results even when directories exist.Root Cause Analysis
Path::to_string_lossy()returns platform-native separators:src/components/Button.tsxsrc\components\Button.tsxfff uses
rfind('/')in 10+ locations to extract directory parts:On Windows,
rfind('/')returnsNone→fname_offset = 0→ entire path treated as filename → no directory part extracted →directorySearchfinds nothing.Solution
Added
normalize_path_separator()helper inpath_utils.rs:Applied to all 3 path-to-string conversion points:
find_file_index(line 208) - file lookup by pathnew_with_metadata(line 311) - runtime file creationnew_from_walk(line 365) - initial filesystem indexingAdditional Fix
Removed frecency filter in
score.rsthat was hiding directories without access history:Steps to Reproduce
directorySearch('component')Testing
cargo build --releasepassesdirectorySearchnow returns results on Windows