Skip to content

Commit 92c4532

Browse files
Use Uri to convert paths to platform specific fs paths
1 parent 0265bef commit 92c4532

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

extensions/ql-vscode/test/vscode-tests/cli-integration/variant-analysis/variant-analysis-manager.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { Uri } from "vscode";
2-
import { CancellationTokenSource, commands, window } from "vscode";
1+
import { CancellationTokenSource, commands, window, Uri } from "vscode";
32
import { extLogger } from "../../../../src/common/logging/vscode";
43
import { setRemoteControllerRepo } from "../../../../src/config";
54
import * as ghApiClient from "../../../../src/variant-analysis/gh-api/gh-api-client";
@@ -453,10 +452,11 @@ describe("Variant Analysis Manager", () => {
453452
}
454453

455454
function getFileOrDir(path: string): string {
455+
// Use `Uri.file(path).fsPath` to make sure the path is in the correct format for the OS (i.e. forward/backward slashes).
456456
if (isAbsolute(path)) {
457-
return path;
457+
return Uri.file(path).fsPath;
458458
} else {
459-
return join(baseDir, path);
459+
return Uri.file(join(baseDir, path)).fsPath;
460460
}
461461
}
462462
});

0 commit comments

Comments
 (0)