Skip to content

Conversation

@samhvw8
Copy link
Contributor

@samhvw8 samhvw8 commented Apr 13, 2025

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

before after
image image

How to Test

Get in Touch


Important

Normalize file paths to POSIX format in searchWorkspaceFiles in file-search.ts.

  • Behavior:
    • Normalize file paths to POSIX format in searchWorkspaceFiles in file-search.ts.
    • Affects both file and folder paths in search results.
  • Functions:
    • Modify searchWorkspaceFiles to use toPosix() on result.path.
    • Ensures consistent path format across different operating systems.

This description was created by Ellipsis for 826f298. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Apr 13, 2025

⚠️ No Changeset found

Latest commit: 826f298

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 13, 2025
const isDirectory = fs.lstatSync(fullPath).isDirectory()
return {
...result,
path: result.path.toPosix(),
Copy link
Contributor

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.

Suggested change
path: result.path.toPosix(),
path: path.posix.normalize(result.path),

@dosubot dosubot bot added the bug Something isn't working label Apr 13, 2025
@mrubens
Copy link
Collaborator

mrubens commented Apr 13, 2025

Is this confusing for people on windows? And do we use posix paths for the open tabs?

@samhvw8
Copy link
Contributor Author

samhvw8 commented Apr 13, 2025

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

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 13, 2025
@mrubens mrubens merged commit 494af30 into RooCodeInc:main Apr 13, 2025
21 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants