Skip to content

Commit 295e724

Browse files
move auto format to the edit menu
1 parent 8a1cabd commit 295e724

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

arduino-ide-extension/src/browser/contributions/edit-contributions.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ ${value}
141141
label: nls.localize('arduino/editor/decreaseIndent', 'Decrease Indent'),
142142
order: '2',
143143
});
144+
registry.registerMenuAction(ArduinoMenus.EDIT__CODE_CONTROL_GROUP, {
145+
commandId: EditContributions.Commands.AUTO_FORMAT.id,
146+
label: nls.localize('arduino/editor/autoFormat', 'Auto Format'), // XXX: The Java IDE uses `Use Selection For Find`.
147+
order: '3',
148+
});
144149

145150
registry.registerMenuAction(ArduinoMenus.EDIT__FONT_CONTROL_GROUP, {
146151
commandId: EditContributions.Commands.INCREASE_FONT_SIZE.id,
@@ -188,13 +193,6 @@ ${value}
188193
), // XXX: The Java IDE uses `Use Selection For Find`.
189194
order: '3',
190195
});
191-
192-
// `Tools`
193-
registry.registerMenuAction(ArduinoMenus.TOOLS__MAIN_GROUP, {
194-
commandId: EditContributions.Commands.AUTO_FORMAT.id,
195-
label: nls.localize('arduino/editor/autoFormat', 'Auto Format'), // XXX: The Java IDE uses `Use Selection For Find`.
196-
order: '0',
197-
});
198196
}
199197

200198
override registerKeybindings(registry: KeybindingRegistry): void {
@@ -248,10 +246,13 @@ ${value}
248246
});
249247
}
250248

251-
protected async current(): Promise<ICodeEditor | StandaloneCodeEditor | undefined> {
249+
protected async current(): Promise<
250+
ICodeEditor | StandaloneCodeEditor | undefined
251+
> {
252252
return (
253253
this.codeEditorService.getFocusedCodeEditor() ||
254-
this.codeEditorService.getActiveCodeEditor() || undefined
254+
this.codeEditorService.getActiveCodeEditor() ||
255+
undefined
255256
);
256257
}
257258

arduino-ide-extension/src/browser/menu/arduino-menus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export namespace ArduinoMenus {
8686

8787
// -- Tools
8888
export const TOOLS = [...MAIN_MENU_BAR, '4_tools'];
89-
// `Auto Format`, `Archive Sketch`, `Manage Libraries...`, `Serial Monitor`, Serial Plotter
89+
// `Archive Sketch`, `Manage Libraries...`, `Serial Monitor`, Serial Plotter
9090
export const TOOLS__MAIN_GROUP = [...TOOLS, '0_main'];
9191
// `WiFi101 / WiFiNINA Firmware Updater`
9292
export const TOOLS__FIRMWARE_UPLOADER_GROUP = [

0 commit comments

Comments
 (0)