From 19757c8799dd02e3f251393fa16f1ad9a93f7b45 Mon Sep 17 00:00:00 2001 From: Igor Vinokur Date: Thu, 8 Oct 2020 14:36:06 +0300 Subject: [PATCH] Fix SCM accept input commnad Signed-off-by: Igor Vinokur --- packages/scm/src/browser/scm-contribution.ts | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/packages/scm/src/browser/scm-contribution.ts b/packages/scm/src/browser/scm-contribution.ts index b50cff2561769..b2012876957e3 100644 --- a/packages/scm/src/browser/scm-contribution.ts +++ b/packages/scm/src/browser/scm-contribution.ts @@ -34,9 +34,9 @@ import { ScmService } from './scm-service'; import { ScmWidget } from '../browser/scm-widget'; import URI from '@theia/core/lib/common/uri'; import { ScmQuickOpenService } from './scm-quick-open-service'; -import { ScmRepository } from './scm-repository'; import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution'; import { ColorRegistry, Color } from '@theia/core/lib/browser/color-registry'; +import { ScmCommand } from './scm-provider'; export const SCM_WIDGET_FACTORY_ID = ScmWidget.ID; export const SCM_VIEW_CONTAINER_ID = 'scm-view-container'; @@ -222,26 +222,16 @@ export class ScmContribution extends AbstractViewContribution impleme protected async acceptInput(): Promise { const command = this.acceptInputCommand(); - if (command) { - await this.commands.executeCommand(command.command, command.repository); + if (command && command.command) { + await this.commands.executeCommand(command.command, ...command.arguments); } } - protected acceptInputCommand(): { - command: string - repository: ScmRepository - } | undefined { + protected acceptInputCommand(): ScmCommand | undefined { const repository = this.scmService.selectedRepository; if (!repository) { return undefined; } - const command = repository.provider.acceptInputCommand; - if (!command || !command.command) { - return undefined; - } - return { - command: command.command, - repository - }; + return repository.provider.acceptInputCommand; } protected readonly statusBarDisposable = new DisposableCollection();