From 82c2bc46edf82168464a97ab9a8130ee59acb521 Mon Sep 17 00:00:00 2001 From: Alexander Kozinko Date: Mon, 19 Apr 2021 02:11:37 +0300 Subject: [PATCH] [vscode] Read args from keybindings #9126 Signed-off-by: Alexander Kozinko --- packages/plugin-ext/src/common/plugin-protocol.ts | 4 ++++ packages/plugin-ext/src/hosted/node/scanners/scanner-theia.ts | 3 ++- .../browser/keybindings/keybindings-contribution-handler.ts | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/plugin-ext/src/common/plugin-protocol.ts b/packages/plugin-ext/src/common/plugin-protocol.ts index 2d02475f4dd8b..48018a56c53c5 100644 --- a/packages/plugin-ext/src/common/plugin-protocol.ts +++ b/packages/plugin-ext/src/common/plugin-protocol.ts @@ -154,6 +154,8 @@ export interface PluginPackageKeybinding { mac?: string; linux?: string; win?: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + args?: any; } export interface PluginPackageGrammarsContribution { @@ -706,6 +708,8 @@ export interface Keybinding { mac?: string; linux?: string; win?: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + args?: any; } /** diff --git a/packages/plugin-ext/src/hosted/node/scanners/scanner-theia.ts b/packages/plugin-ext/src/hosted/node/scanners/scanner-theia.ts index c97f268f0cdd7..8c7187d42dbfa 100644 --- a/packages/plugin-ext/src/hosted/node/scanners/scanner-theia.ts +++ b/packages/plugin-ext/src/hosted/node/scanners/scanner-theia.ts @@ -492,7 +492,8 @@ export class TheiaPluginScanner implements PluginScanner { when: rawKeybinding.when, mac: rawKeybinding.mac, linux: rawKeybinding.linux, - win: rawKeybinding.win + win: rawKeybinding.win, + args: rawKeybinding.args }; } diff --git a/packages/plugin-ext/src/main/browser/keybindings/keybindings-contribution-handler.ts b/packages/plugin-ext/src/main/browser/keybindings/keybindings-contribution-handler.ts index 70c818d091380..8ce2a7174feff 100644 --- a/packages/plugin-ext/src/main/browser/keybindings/keybindings-contribution-handler.ts +++ b/packages/plugin-ext/src/main/browser/keybindings/keybindings-contribution-handler.ts @@ -47,8 +47,8 @@ export class KeybindingsContributionPointHandler { if (!keybinding) { return undefined; } - const { command, when } = pluginKeybinding; - return { keybinding, command, when }; + const { command, when, args } = pluginKeybinding; + return { keybinding, command, when, args }; } protected toOSKeybinding(pluginKeybinding: PluginKeybinding): string | undefined {