Skip to content

Commit 7f0bff8

Browse files
committed
debug: seperator in launch drop down
1 parent 7eed3b0 commit 7f0bff8

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/vs/base/browser/ui/selectBox/selectBox.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ export class SelectBox extends Widget {
4040
return this._onDidSelect.event;
4141
}
4242

43-
public setOptions(options: string[], selected?: number): void {
43+
public setOptions(options: string[], selected?: number, disabled?: number): void {
4444
if (!this.options || !arrays.equals(this.options, options)) {
4545
this.options = options;
4646

4747
this.selectElement.options.length = 0;
48+
let i = 0;
4849
this.options.forEach((option) => {
49-
this.selectElement.add(this.createOption(option));
50+
this.selectElement.add(this.createOption(option, disabled === i++));
5051
});
5152
}
5253
this.select(selected);
@@ -91,10 +92,11 @@ export class SelectBox extends Widget {
9192
this.setOptions(this.options, this.selected);
9293
}
9394

94-
private createOption(value: string): HTMLOptionElement {
95+
private createOption(value: string, disabled?: boolean): HTMLOptionElement {
9596
let option = document.createElement('option');
9697
option.value = value;
9798
option.text = value;
99+
option.disabled = disabled;
98100

99101
return option;
100102
}

src/vs/workbench/parts/debug/browser/debugActionItems.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const $ = dom.$;
2222
export class StartDebugActionItem extends EventEmitter implements IActionItem {
2323

2424
private static ADD_CONFIGURATION = nls.localize('addConfiguration', "Add Configuration...");
25+
private static SEPARATOR = '─────────';
2526

2627
public actionRunner: IActionRunner;
2728
private container: HTMLElement;
@@ -132,8 +133,9 @@ export class StartDebugActionItem extends EventEmitter implements IActionItem {
132133
} else {
133134
this.setEnabled(true);
134135
const selected = options.indexOf(this.debugService.getViewModel().selectedConfigurationName);
136+
options.push(StartDebugActionItem.SEPARATOR);
135137
options.push(StartDebugActionItem.ADD_CONFIGURATION);
136-
this.selectBox.setOptions(options, selected);
138+
this.selectBox.setOptions(options, selected, options.length - 2);
137139
}
138140
}
139141
}

0 commit comments

Comments
 (0)