Skip to content

Commit 1e1594b

Browse files
committed
Use fsPath instead of path everywhere
1 parent 636be05 commit 1e1594b

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

extensions/ql-vscode/src/skeleton-query-wizard.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,16 @@ export class SkeletonQueryWizard {
9999
}
100100

101101
const firstFolder = workspaceFolders[0];
102+
const firstFolderFsPath = firstFolder.uri.fsPath;
102103

103104
// For the vscode-codeql-starter repo, the first folder will be a ql pack
104105
// so we need to get the parent folder
105-
if (firstFolder.uri.path.includes("codeql-custom-queries")) {
106+
if (firstFolderFsPath.includes("codeql-custom-queries")) {
106107
// return the parent folder
107-
return dirname(firstFolder.uri.fsPath);
108+
return dirname(firstFolderFsPath);
108109
} else {
109110
// if the first folder is not a ql pack, then we are in a normal workspace
110-
return firstFolder.uri.fsPath;
111+
return firstFolderFsPath;
111112
}
112113
}
113114

extensions/ql-vscode/test/vscode-tests/cli-integration/skeleton-query-wizard.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ describe("SkeletonQueryWizard", () => {
8383
jest.spyOn(workspace, "workspaceFolders", "get").mockReturnValue([
8484
{
8585
name: `codespaces-codeql`,
86-
uri: { path: storagePath },
86+
uri: { fsPath: storagePath },
8787
},
8888
{
8989
name: "/second/folder/path",
90-
uri: { path: storagePath },
90+
uri: { fsPath: storagePath },
9191
},
9292
] as WorkspaceFolder[]);
9393

@@ -306,7 +306,7 @@ describe("SkeletonQueryWizard", () => {
306306
jest.spyOn(workspace, "workspaceFolders", "get").mockReturnValue([
307307
{
308308
name: "codespaces-codeql",
309-
uri: { path: "codespaces-codeql" },
309+
uri: { fsPath: "codespaces-codeql" },
310310
},
311311
] as WorkspaceFolder[]);
312312

@@ -327,11 +327,13 @@ describe("SkeletonQueryWizard", () => {
327327
jest.spyOn(workspace, "workspaceFolders", "get").mockReturnValue([
328328
{
329329
name: "codeql-custom-queries-cpp",
330-
uri: { path: "vscode-codeql-starter/codeql-custom-queries-cpp" },
330+
uri: { fsPath: "vscode-codeql-starter/codeql-custom-queries-cpp" },
331331
},
332332
{
333333
name: "codeql-custom-queries-csharp",
334-
uri: { path: "vscode-codeql-starter/codeql-custom-queries-csharp" },
334+
uri: {
335+
fsPath: "vscode-codeql-starter/codeql-custom-queries-csharp",
336+
},
335337
},
336338
] as WorkspaceFolder[]);
337339

@@ -369,7 +371,7 @@ describe("SkeletonQueryWizard", () => {
369371
jest.spyOn(workspace, "workspaceFolders", "get").mockReturnValue([
370372
{
371373
name: "codespaces-codeql",
372-
uri: { path: "codespaces-codeql\\codeql-custom-queries-cpp" },
374+
uri: { fsPath: "codespaces-codeql\\codeql-custom-queries-cpp" },
373375
},
374376
] as WorkspaceFolder[]);
375377

0 commit comments

Comments
 (0)