diff --git a/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts b/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts index c48efd1ee959254069398b8cdb77c3c320735fc4..767b547b64f82427da176aca2530561a1fd60554 100644 --- a/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts +++ b/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts @@ -159,6 +159,7 @@ export class StartDebugActionViewItem implements IActionViewItem { const manager = this.debugService.getConfigurationManager(); const inWorkspace = this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE; let lastGroup: string | undefined; + const disabledIdxs: number[] = []; manager.getAllConfigurations().forEach(({ launch, name, presentation }) => { if (name === manager.selectedConfiguration.name && launch === manager.selectedConfiguration.launch) { this.selected = this.options.length; @@ -167,6 +168,7 @@ export class StartDebugActionViewItem implements IActionViewItem { lastGroup = presentation?.group; if (this.options.length) { this.options.push({ label: StartDebugActionViewItem.SEPARATOR, handler: undefined }); + disabledIdxs.push(this.options.length - 1); } } @@ -178,9 +180,9 @@ export class StartDebugActionViewItem implements IActionViewItem { this.options.push({ label: nls.localize('noConfigurations', "No Configurations"), handler: () => false }); } else { this.options.push({ label: StartDebugActionViewItem.SEPARATOR, handler: undefined }); + disabledIdxs.push(this.options.length - 1); } - const disabledIdx = this.options.length - 1; manager.getLaunches().filter(l => !l.hidden).forEach(l => { const label = inWorkspace ? nls.localize("addConfigTo", "Add Config ({0})...", l.name) : nls.localize('addConfiguration', "Add Configuration..."); this.options.push({ @@ -191,7 +193,7 @@ export class StartDebugActionViewItem implements IActionViewItem { }); }); - this.selectBox.setOptions(this.options.map((data, index) => { text: data.label, isDisabled: (index === disabledIdx ? true : undefined) }), this.selected); + this.selectBox.setOptions(this.options.map((data, index) => { text: data.label, isDisabled: disabledIdxs.indexOf(index) !== -1 }), this.selected); } } diff --git a/src/vs/workbench/contrib/output/browser/outputActions.ts b/src/vs/workbench/contrib/output/browser/outputActions.ts index 1d16cfea3b137b889c1048b8e53234c8c65ac6a7..4686280ec9a897b43672031d3c00138e520a5934 100644 --- a/src/vs/workbench/contrib/output/browser/outputActions.ts +++ b/src/vs/workbench/contrib/output/browser/outputActions.ts @@ -173,7 +173,7 @@ export class SwitchOutputActionViewItem extends SelectActionViewItem { selected = logChannelIndex !== -1 ? separatorIndex + 1 + logChannelIndex : 0; } } - this.setOptions(options.map((label, index) => { text: label, isDisabled: (index === separatorIndex ? true : undefined) }), Math.max(0, selected)); + this.setOptions(options.map((label, index) => { text: label, isDisabled: (index === separatorIndex ? true : false) }), Math.max(0, selected)); } }