Fix setting file count description to be for user selected files

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
Sanjula Ganepola
2024-11-21 22:24:58 -05:00
parent c10f7109ac
commit 9079f014c9
3 changed files with 6 additions and 3 deletions

View File

@@ -12,8 +12,9 @@ export default class VariablesTreeItem extends TreeItem implements GithubLocalAc
constructor(public workspaceFolder: WorkspaceFolder, variables: Setting[], variableFiles: SettingFile[]) {
super('Variables', TreeItemCollapsibleState.Collapsed);
const selectedVariableFiles = variableFiles.filter(variableFile => variableFile.selected);
this.description = `${variables.filter(variable => variable.selected).length}/${variables.length}` +
(variableFiles.length > 0 ? ` + ${variableFiles.length} variable file(s)` : ``);
(selectedVariableFiles.length > 0 ? ` + ${selectedVariableFiles.length} variable file(s)` : ``);
this.contextValue = VariablesTreeItem.contextValue;
this.iconPath = new ThemeIcon('symbol-key');
}