Skip to content

Commit 8cd7297

Browse files
author
Akos Kitta
committed
feat: show the selected board config value on menu
closes #343 Signed-off-by: Akos Kitta <[email protected]>
1 parent d3a8639 commit 8cd7297

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Diff for: arduino-ide-extension/src/browser/boards/boards-data-menu-updater.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ export class BoardsDataMenuUpdater implements FrontendApplicationContribution {
8080
string,
8181
Disposable & { label: string }
8282
>();
83+
let selectedValue = '';
8384
for (const value of values) {
8485
const id = `${fqbn}-${option}--${value.value}`;
8586
const command = { id };
86-
const selectedValue = value.value;
8787
const handler = {
8888
execute: () =>
8989
this.boardsDataStore.selectConfigOption({
9090
fqbn,
9191
option,
92-
selectedValue,
92+
selectedValue: value.value,
9393
}),
9494
isToggled: () => value.selected,
9595
};
@@ -100,8 +100,14 @@ export class BoardsDataMenuUpdater implements FrontendApplicationContribution {
100100
{ label: value.label }
101101
)
102102
);
103+
if (value.selected) {
104+
selectedValue = value.label;
105+
}
103106
}
104-
this.menuRegistry.registerSubmenu(menuPath, label);
107+
this.menuRegistry.registerSubmenu(
108+
menuPath,
109+
`${label}${selectedValue ? `: "${selectedValue}"` : ''}`
110+
);
105111
this.toDisposeOnBoardChange.pushAll([
106112
...commands.values(),
107113
Disposable.create(() =>

0 commit comments

Comments
 (0)