提交 04c805a9 编写于 作者: I isidor

debug select make sure all separators are disabled

上级 befcf142
......@@ -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) => <ISelectOptionItem>{ text: data.label, isDisabled: (index === disabledIdx ? true : undefined) }), this.selected);
this.selectBox.setOptions(this.options.map((data, index) => <ISelectOptionItem>{ text: data.label, isDisabled: disabledIdxs.indexOf(index) !== -1 }), this.selected);
}
}
......
......@@ -173,7 +173,7 @@ export class SwitchOutputActionViewItem extends SelectActionViewItem {
selected = logChannelIndex !== -1 ? separatorIndex + 1 + logChannelIndex : 0;
}
}
this.setOptions(options.map((label, index) => <ISelectOptionItem>{ text: label, isDisabled: (index === separatorIndex ? true : undefined) }), Math.max(0, selected));
this.setOptions(options.map((label, index) => <ISelectOptionItem>{ text: label, isDisabled: (index === separatorIndex ? true : false) }), Math.max(0, selected));
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册