Closes #3308. Thanks for fixing the misleading Windows status diagnostic and adding the focused regression tests.
13 lines
613 B
TypeScript
13 lines
613 B
TypeScript
/**
|
|
* Normalize Windows drive letter to uppercase.
|
|
*
|
|
* VS Code's `workspaceFolders[0].uri.fsPath` returns lowercase drive letters (e.g. `d:\...`),
|
|
* while process.cwd() (used by OpenCode server) returns uppercase (e.g. `D:\...`).
|
|
* Normalize to uppercase so session directory queries match.
|
|
*/
|
|
export const normalizeWindowsDriveLetter = (p: string): string =>
|
|
p.replace(/^([a-z]):/, (_, letter: string) => letter.toUpperCase() + ':');
|
|
|
|
export const pathsEqualWithNormalizedDriveLetter = (left: string, right: string): boolean =>
|
|
normalizeWindowsDriveLetter(left) === normalizeWindowsDriveLetter(right);
|