From 2c1b65ddfd084e4dd0b74a23ded078eedd94ce8e Mon Sep 17 00:00:00 2001 From: Florian Greinacher Date: Thu, 12 Nov 2020 13:54:55 +0000 Subject: [PATCH] feat(vscode): add support for "workbench.extensions.installExtension" command --- .../src/browser/plugin-vscode-commands-contribution.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts b/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts index 440730fb20a6b..3305f3b3c9d8e 100755 --- a/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts +++ b/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts @@ -53,6 +53,7 @@ import { DiffService } from '@theia/workspace/lib/browser/diff-service'; import { inject, injectable } from 'inversify'; import { Position } from '@theia/plugin-ext/lib/common/plugin-api-rpc'; import { URI } from 'vscode-uri'; +import { PluginServer } from '@theia/plugin-ext/lib/common/plugin-protocol'; import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor'; import { TerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution'; import { QuickOpenWorkspace } from '@theia/workspace/lib/browser/quick-open-workspace'; @@ -106,6 +107,8 @@ export class PluginVscodeCommandsContribution implements CommandContribution { protected readonly terminalService: TerminalService; @inject(CodeEditorWidgetUtil) protected readonly codeEditorWidgetUtil: CodeEditorWidgetUtil; + @inject(PluginServer) + protected readonly pluginServer: PluginServer; registerCommands(commands: CommandRegistry): void { commands.registerCommand(VscodeCommands.OPEN, { @@ -208,6 +211,9 @@ export class PluginVscodeCommandsContribution implements CommandContribution { commands.registerCommand({ id: 'workbench.action.openSettings' }, { execute: () => commands.executeCommand(CommonCommands.OPEN_PREFERENCES.id) }); + commands.registerCommand({ id: 'workbench.extensions.installExtension' }, { + execute: (id: string) => this.pluginServer.deploy(id) + }); commands.registerCommand({ id: 'workbench.action.files.save', }, { execute: (uri?: monaco.Uri) => { if (uri) {