From 33f790a2db942d01d5632026ea3ee68ead96c06c Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 23 Feb 2024 15:36:57 +0100 Subject: [PATCH] fix: disable open keymap split editor from toolbar The complete support for split editor is yet to be added to IDE2. For now, this commit turns off opening the keymaps in the JSON split editor. So that it cannot get the primary IDE2 layout into an inconsistent state. Closes arduino/arduino-ide#1850 Signed-off-by: Akos Kitta --- .../theia/keymaps/keymaps-frontend-contribution.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arduino-ide-extension/src/browser/theia/keymaps/keymaps-frontend-contribution.ts b/arduino-ide-extension/src/browser/theia/keymaps/keymaps-frontend-contribution.ts index 13914d025..752ef1eff 100644 --- a/arduino-ide-extension/src/browser/theia/keymaps/keymaps-frontend-contribution.ts +++ b/arduino-ide-extension/src/browser/theia/keymaps/keymaps-frontend-contribution.ts @@ -1,14 +1,20 @@ +import { CommandRegistry } from '@theia/core/lib/common/command'; +import { MenuModelRegistry } from '@theia/core/lib/common/menu/menu-model-registry'; +import { nls } from '@theia/core/lib/common/nls'; import { injectable } from '@theia/core/shared/inversify'; -import { MenuModelRegistry } from '@theia/core'; import { - KeymapsFrontendContribution as TheiaKeymapsFrontendContribution, KeymapsCommands, + KeymapsFrontendContribution as TheiaKeymapsFrontendContribution, } from '@theia/keymaps/lib/browser/keymaps-frontend-contribution'; import { ArduinoMenus } from '../../menu/arduino-menus'; -import { nls } from '@theia/core/lib/common'; @injectable() export class KeymapsFrontendContribution extends TheiaKeymapsFrontendContribution { + override registerCommands(registry: CommandRegistry): void { + super.registerCommands(registry); + registry.unregisterCommand(KeymapsCommands.OPEN_KEYMAPS_JSON_TOOLBAR.id); + } + override registerMenus(menus: MenuModelRegistry): void { menus.registerMenuAction(ArduinoMenus.FILE__ADVANCED_SUBMENU, { commandId: KeymapsCommands.OPEN_KEYMAPS.id,