Allow the same act options to be added multiple times (#142)

* extract act options from cli command

* remove special options handled by the tree view

* Refactor logic to get act options (#1)

* Refactor get options logic
* Remove bool type options from having descriptions
* Force option description to be uppercase

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>

* disable generic early exit options as well

* filter out stringArray default value

* this removes default values like `[]` regardless if they are sent

* fix quote consitency

* Fix lint errors and move default options to separate func

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>

* Allow multiple of the same options to support stringArray type

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>

* Fix comment

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>

* Exclude list options

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>

---------

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
This commit is contained in:
Sanjula Ganepola
2025-01-18 19:22:10 -05:00
committed by GitHub
parent dc301e47e0
commit 375ca40178
4 changed files with 229 additions and 219 deletions

View File

@@ -214,7 +214,7 @@ export class SettingsManager {
}
}
async editCustomSetting(workspaceFolder: WorkspaceFolder, newCustomSetting: CustomSetting, storageKey: StorageKey) {
async editCustomSetting(workspaceFolder: WorkspaceFolder, newCustomSetting: CustomSetting, storageKey: StorageKey, forceAppend: boolean = false) {
const existingCustomSettings = this.storageManager.get<{ [path: string]: CustomSetting[] }>(storageKey) || {};
if (existingCustomSettings[workspaceFolder.uri.fsPath]) {
const index = existingCustomSettings[workspaceFolder.uri.fsPath]
@@ -223,7 +223,7 @@ export class SettingsManager {
customSetting.name === newCustomSetting.name :
customSetting.path === newCustomSetting.path
);
if (index > -1) {
if (index > -1 && !forceAppend) {
existingCustomSettings[workspaceFolder.uri.fsPath][index] = newCustomSetting;
} else {
existingCustomSettings[workspaceFolder.uri.fsPath].push(newCustomSetting);
@@ -240,7 +240,7 @@ export class SettingsManager {
if (existingCustomSettings[workspaceFolder.uri.fsPath]) {
const index = existingCustomSettings[workspaceFolder.uri.fsPath].findIndex(customSetting =>
storageKey === StorageKey.Options ?
customSetting.name === existingCustomSetting.name :
(customSetting.name === existingCustomSetting.name && customSetting.path === existingCustomSetting.path) :
customSetting.path === existingCustomSetting.path
);
if (index > -1) {