Skip to content

Commit 79d64ef

Browse files
committed
Standardize saved context paths to use forward slashes for consistent storage and sorting
1 parent e212ae5 commit 79d64ef

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/vscode/src/commands/save-context-command.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ export function save_context_command(
278278
})
279279
}
280280

281+
all_prefixed_paths = all_prefixed_paths.map((p) =>
282+
p.replace(/\\/g, '/')
283+
)
284+
281285
all_prefixed_paths.sort((a, b) => {
282286
const workspace_folders = vscode.workspace.workspaceFolders
283287

@@ -301,8 +305,8 @@ export function save_context_command(
301305
const path_part_a = get_path_part_for_sorting(a)
302306
const path_part_b = get_path_part_for_sorting(b)
303307

304-
const is_nested_a = path_part_a.includes(path.sep)
305-
const is_nested_b = path_part_b.includes(path.sep)
308+
const is_nested_a = path_part_a.includes('/')
309+
const is_nested_b = path_part_b.includes('/')
306310

307311
if (is_nested_a && !is_nested_b) {
308312
return -1

0 commit comments

Comments
 (0)