Refactor to use workspace folders

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
Sanjula Ganepola
2024-10-19 20:20:48 -04:00
parent f4a73316f4
commit 49e934e297
26 changed files with 515 additions and 206 deletions

View File

@@ -1,16 +1,25 @@
import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from "vscode";
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
import { act } from "../../extension";
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
import ContainerEngineTreeItem from "./containerEngine";
export default class ContainerEnginesTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
static contextValue = 'githubLocalActions.containerEngines';
constructor() {
constructor(public workspaceFolder: WorkspaceFolder) {
super('Container Engines', TreeItemCollapsibleState.Collapsed);
this.contextValue = ContainerEnginesTreeItem.contextValue;
this.iconPath = new ThemeIcon('server-process');
}
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
return [];
const items: GithubLocalActionsTreeItem[] = [];
const containerEngines = act.settingsManager.getSettings(this.workspaceFolder).containerEngines;
for (const containerEngine of containerEngines) {
items.push(new ContainerEngineTreeItem(this.workspaceFolder, containerEngine));
}
return items;
}
}