Skip to content

Commit 6e36818

Browse files
Add Auto Format item under the Edit menu (#1230)
1 parent 8a1cabd commit 6e36818

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Diff for: arduino-ide-extension/src/browser/contributions/edit-contributions.ts

+10-2
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'),
147+
order: '3',
148+
});
144149

145150
registry.registerMenuAction(ArduinoMenus.EDIT__FONT_CONTROL_GROUP, {
146151
commandId: EditContributions.Commands.INCREASE_FONT_SIZE.id,
@@ -248,10 +253,13 @@ ${value}
248253
});
249254
}
250255

251-
protected async current(): Promise<ICodeEditor | StandaloneCodeEditor | undefined> {
256+
protected async current(): Promise<
257+
ICodeEditor | StandaloneCodeEditor | undefined
258+
> {
252259
return (
253260
this.codeEditorService.getFocusedCodeEditor() ||
254-
this.codeEditorService.getActiveCodeEditor() || undefined
261+
this.codeEditorService.getActiveCodeEditor() ||
262+
undefined
255263
);
256264
}
257265

0 commit comments

Comments
 (0)