diff --git a/packages/monaco/src/browser/monaco-command.ts b/packages/monaco/src/browser/monaco-command.ts index 0bc9c69eda93a..63c57b57c29e1 100644 --- a/packages/monaco/src/browser/monaco-command.ts +++ b/packages/monaco/src/browser/monaco-command.ts @@ -135,7 +135,7 @@ export class MonacoEditorCommandHandlers implements CommandContribution { * and execute them using the instantiation service of the current editor. */ protected registerMonacoCommands(): void { - const editorActions = new Map(EditorExtensionsRegistry.getEditorActions().map(({ id, label }) => [id, label])); + const editorActions = new Map(EditorExtensionsRegistry.getEditorActions().map(({ id, label, alias }) => [id, { label, alias }])); const { codeEditorService } = this; const globalInstantiationService = StandaloneServices.initialize({}); @@ -179,8 +179,8 @@ export class MonacoEditorCommandHandlers implements CommandContribution { return true; } }; - const label = editorActions.get(id); - this.commandRegistry.registerCommand({ id, label }, handler); + const commandAction = editorActions.get(id); + this.commandRegistry.registerCommand({ id, label: commandAction?.label, originalLabel: commandAction?.alias }, handler); const coreCommand = MonacoCommands.COMMON_ACTIONS.get(id); if (coreCommand) { this.commandRegistry.registerHandler(coreCommand, handler);