From b0d97946d1552c8fa057c7c7307a8b6e2c445c2f Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Mon, 17 Nov 2025 21:58:11 -0800 Subject: [PATCH 1/3] build: remove unused monaco features --- tools/webpack/webpack.renderer.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/webpack/webpack.renderer.config.ts b/tools/webpack/webpack.renderer.config.ts index f5f933a000..ee90492d7e 100644 --- a/tools/webpack/webpack.renderer.config.ts +++ b/tools/webpack/webpack.renderer.config.ts @@ -63,6 +63,7 @@ export const rendererConfig: Configuration = { ...plugins, new MonacoWebpackPlugin({ languages: ['typescript', 'javascript', 'html', 'css'], + features: ['!contextmenu', '!iPadShowKeyboard', '!snippets'], }), new MiniCssExtractPlugin({ filename: './css/[name].css', From 8e53d564eae3a536c80abcf479fc260ae1a86fe6 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Tue, 18 Nov 2025 15:11:36 -0800 Subject: [PATCH 2/3] add more things, remove command palette --- src/main/context-menu.ts | 9 --------- tools/webpack/webpack.renderer.config.ts | 10 +++++++++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/context-menu.ts b/src/main/context-menu.ts index 858754a0ef..5d89b28a1f 100644 --- a/src/main/context-menu.ts +++ b/src/main/context-menu.ts @@ -69,15 +69,6 @@ export function getMonacoItems({ }, }, { type: 'separator' }, - { - id: 'palette', - label: 'Command Palette', - click() { - const cmd = ['editor.action.quickCommand']; - ipcMainManager.send(IpcEvents.MONACO_EXECUTE_COMMAND, cmd); - }, - }, - { type: 'separator' }, { id: 'format_document', label: 'Format Document', diff --git a/tools/webpack/webpack.renderer.config.ts b/tools/webpack/webpack.renderer.config.ts index ee90492d7e..578da938ce 100644 --- a/tools/webpack/webpack.renderer.config.ts +++ b/tools/webpack/webpack.renderer.config.ts @@ -63,7 +63,15 @@ export const rendererConfig: Configuration = { ...plugins, new MonacoWebpackPlugin({ languages: ['typescript', 'javascript', 'html', 'css'], - features: ['!contextmenu', '!iPadShowKeyboard', '!snippets'], + // This array maps to specific entries in the Monaco metadata + // To see a full list and where they map to in VSCode, see 'monaco-editor/esm/metadata' + features: [ + '!contextmenu', + '!iPadShowKeyboard', + '!snippets', + '!quickCommand', + '!quickOutline', + ], }), new MiniCssExtractPlugin({ filename: './css/[name].css', From 1c7e8a299c5456371c33bdf42fcbcb10ff6bcb11 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Tue, 18 Nov 2025 15:17:21 -0800 Subject: [PATCH 3/3] zzz --- tests/main/context-menu-spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/main/context-menu-spec.ts b/tests/main/context-menu-spec.ts index 094db446ac..8ceaedd2a2 100644 --- a/tests/main/context-menu-spec.ts +++ b/tests/main/context-menu-spec.ts @@ -203,7 +203,7 @@ describe('context-menu', () => { editFlags: { canPaste: true }, pageURL: 'index.html', } as any); - expect(result).toHaveLength(10); + expect(result).toHaveLength(8); }); it('executes an IPC send() for each element', () => {