Skip to content

Commit d626cea

Browse files
Use getOnDiskWorkspaceFolders instead of getOnDiskWorkspaceFoldersObjects when all we need is the path
1 parent bdea0c2 commit d626cea

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

extensions/ql-vscode/src/common/vscode/file-path-discovery.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import { AppEventEmitter } from "../events";
1111
import { extLogger } from "..";
1212
import { lstat } from "fs-extra";
1313
import { containsPath, isIOError } from "../../pure/files";
14-
import { getOnDiskWorkspaceFoldersObjects } from "./workspace-folders";
14+
import {
15+
getOnDiskWorkspaceFolders,
16+
getOnDiskWorkspaceFoldersObjects,
17+
} from "./workspace-folders";
1518

1619
interface PathData {
1720
path: string;
@@ -88,8 +91,8 @@ export abstract class FilePathDiscovery<T extends PathData> extends Discovery {
8891
* Do the initial scan of the entire workspace and set up watchers for future changes.
8992
*/
9093
public async initialRefresh() {
91-
getOnDiskWorkspaceFoldersObjects().forEach((workspaceFolder) => {
92-
this.changedFilePaths.add(workspaceFolder.uri.fsPath);
94+
getOnDiskWorkspaceFolders().forEach((workspaceFolder) => {
95+
this.changedFilePaths.add(workspaceFolder);
9396
});
9497

9598
this.updateWatchers();
@@ -161,8 +164,8 @@ export abstract class FilePathDiscovery<T extends PathData> extends Discovery {
161164
}
162165

163166
private pathIsInWorkspace(path: string): boolean {
164-
return getOnDiskWorkspaceFoldersObjects().some((workspaceFolder) =>
165-
containsPath(workspaceFolder.uri.fsPath, path),
167+
return getOnDiskWorkspaceFolders().some((workspaceFolder) =>
168+
containsPath(workspaceFolder, path),
166169
);
167170
}
168171

0 commit comments

Comments
 (0)