Skip to content

Commit

Permalink
Add original labels for monaco commands (#11434)
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew authored Jul 18, 2022
1 parent f3c48a9 commit 78b7f95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/monaco/src/browser/monaco-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({});
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 78b7f95

Please sign in to comment.