Repository navigation
Conversation
normalizePath replaced every backslash with a slash on all platforms, so glob and grep reported a nonexistent path for files whose name contains a backslash on Unix. Only Windows needs separator normalization.
There was a problem hiding this comment.
Looks good. I ran the #60307 reproduction against the real ripgrep service on Linux. On the base, glob and grep report actual/name.txt for a file named actual\name.txt; with this change they report the real name. bun test test/ripgrep.test.ts passes, the new test fails on the base, and typecheck:tsc passes.
glob, find and grep all go through normalizePath, so all three are covered. Windows behaviour is unchanged, and on POSIX the leading ./ and / are still stripped as before.
Public API: unchanged.
No concerns.
There was a problem hiding this comment.
The new commit only merges dev, and this pull request's own changes are the same as before. I re-ran the #60307 reproduction on the new head: glob and grep still return the real actual\name.txt. test/ripgrep.test.ts and typecheck:tsc pass.
Public API: unchanged.
No concerns.
Issue for this PR
Closes #60307
Type of change
What does this PR do?
On Unix a backslash is a legal filename character, but
normalizePathinpackages/core/src/ripgrep.tsreplaced every\with/on all platforms.globandgreptherefore reportedactual/name.txtfor a file namedactual\name.txt, a path that does not exist, so a model reading or editing the reported result targets the wrong file or fails.That normalization is only needed on Windows, where ripgrep reports separators as backslashes. The function now keeps literal backslashes and only strips a leading
./or/elsewhere.How did you verify your code works?
New test in
packages/core/test/ripgrep.test.tscreatesactual\name.txtand checks bothglobandgrep. Before the change it fails:After the change,
cd packages/core && bun test test/ripgrep.test.ts:bun run typecheck:tscpasses.Checklist