Add selected and total count to settings description

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
Sanjula Ganepola
2024-11-16 23:20:31 -05:00
parent 319520c1d2
commit ff1864faf5
11 changed files with 43 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
import { act } from "../../extension";
import { SettingsManager } from "../../settingsManager";
import { Setting, SettingsManager } from "../../settingsManager";
import { StorageKey } from "../../storageManager";
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
import SettingTreeItem from "./setting";
@@ -8,8 +8,9 @@ import SettingTreeItem from "./setting";
export default class VariablesTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
static contextValue = 'githubLocalActions.variables';
constructor(public workspaceFolder: WorkspaceFolder) {
constructor(public workspaceFolder: WorkspaceFolder, variables: Setting[]) {
super('Variables', TreeItemCollapsibleState.Collapsed);
this.description = `${variables.filter(variable => variable.selected).length}/${variables.length}`;
this.contextValue = VariablesTreeItem.contextValue;
this.iconPath = new ThemeIcon('symbol-key');
}