-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: normalize file paths to POSIX format in search results #2569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
| const isDirectory = fs.lstatSync(fullPath).isDirectory() | ||
| return { | ||
| ...result, | ||
| path: result.path.toPosix(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that toPosix() is a defined method on the string type. Node's native String does not include toPosix(); if this is a custom extension, please confirm its availability. Otherwise, consider using a standard approach like path.posix.normalize(result.path) to reliably convert paths to POSIX format. Also, note that normalization is only applied when the file exists; consider applying it consistently for all results.
| path: result.path.toPosix(), | |
| path: path.posix.normalize(result.path), |
|
Is this confusing for people on windows? And do we use posix paths for the open tabs? |
Previously, we dont have file search service we have posix normalize almost everywhere in codebase, but we can change by support window path style if we support window path style it is hard to add escape space, that will make our regex to complex, and we hard to debug like previous time. So i think we can just convert all to posix to make it support escape path, and if we can fix backspace problems in window we can make an follow up pr to add window path style later |
Context
Add normalize path for file search service
This will make pr #2529 can only need to handle POSIX path
and we remake pr for mention escape path by only add for posix both file path, and we can based on this pr #1924
Implementation
Screenshots
How to Test
Get in Touch
Important
Normalize file paths to POSIX format in
searchWorkspaceFilesinfile-search.ts.searchWorkspaceFilesinfile-search.ts.searchWorkspaceFilesto usetoPosix()onresult.path.This description was created by
for 826f298. It will automatically update as commits are pushed.