Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/services/search/file-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export async function searchWorkspaceFiles(
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),

type: isDirectory ? ("folder" as const) : ("file" as const),
}
}
Expand Down