Use getOnDiskWorkspaceFolders instead of getOnDiskWorkspaceFoldersObjects when all we need is the path

This commit is contained in:
Robert
2023-06-16 16:14:08 +01:00
parent bdea0c2c20
commit d626cea837

View File

@@ -11,7 +11,10 @@ import { AppEventEmitter } from "../events";
import { extLogger } from "..";
import { lstat } from "fs-extra";
import { containsPath, isIOError } from "../../pure/files";
import { getOnDiskWorkspaceFoldersObjects } from "./workspace-folders";
import {
getOnDiskWorkspaceFolders,
getOnDiskWorkspaceFoldersObjects,
} from "./workspace-folders";
interface PathData {
path: string;
@@ -88,8 +91,8 @@ export abstract class FilePathDiscovery<T extends PathData> extends Discovery {
* Do the initial scan of the entire workspace and set up watchers for future changes.
*/
public async initialRefresh() {
getOnDiskWorkspaceFoldersObjects().forEach((workspaceFolder) => {
this.changedFilePaths.add(workspaceFolder.uri.fsPath);
getOnDiskWorkspaceFolders().forEach((workspaceFolder) => {
this.changedFilePaths.add(workspaceFolder);
});
this.updateWatchers();
@@ -161,8 +164,8 @@ export abstract class FilePathDiscovery<T extends PathData> extends Discovery {
}
private pathIsInWorkspace(path: string): boolean {
return getOnDiskWorkspaceFoldersObjects().some((workspaceFolder) =>
containsPath(workspaceFolder.uri.fsPath, path),
return getOnDiskWorkspaceFolders().some((workspaceFolder) =>
containsPath(workspaceFolder, path),
);
}