Skip to content

Commit

Permalink
feat(vscode): add support for "workbench.extensions.installExtension"…
Browse files Browse the repository at this point in the history
… command

Signed-off-by: Florian Greinacher <[email protected]>
  • Loading branch information
fgreinacher committed Nov 13, 2020
1 parent 5c164f7 commit 097079f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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, {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 097079f

Please sign in to comment.