From 102ded51927d519536d0153d32dc75c5cf68e5ca Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 27 Apr 2016 17:47:22 +0200 Subject: [PATCH] Git errors - give me action to show output (fixes #5815) --- .../parts/quickopen/browser/commandsHandler.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts index 81156b89dcd..7670b4e3582 100644 --- a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts @@ -27,7 +27,7 @@ import {EditorAction} from 'vs/editor/common/editorAction'; import {Behaviour} from 'vs/editor/common/editorActionEnablement'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; -import {IMessageService, Severity} from 'vs/platform/message/common/message'; +import {IMessageService, Severity, IMessageWithAction} from 'vs/platform/message/common/message'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; import {IQuickOpenService} from 'vs/workbench/services/quickopen/common/quickOpenService'; @@ -92,8 +92,18 @@ class BaseCommandEntry extends QuickOpenEntryGroup { return this.keyLabel; } - protected onError(error?: Error): void { - let message = !error ? nls.localize('canNotRun', "Command '{0}' can not be run from here.", this.label) : toErrorMessage(error); + protected onError(error?: Error): void; + protected onError(messagesWithAction?: IMessageWithAction): void; + protected onError(arg1?: any): void { + let message: any; + + const messagesWithAction: IMessageWithAction = arg1; + if (messagesWithAction && typeof messagesWithAction.message === 'string' && Array.isArray(messagesWithAction.actions)) { + message = messagesWithAction; + } else { + message = !arg1 ? nls.localize('canNotRun', "Command '{0}' can not be run from here.", this.label) : toErrorMessage(arg1); + } + this.messageService.show(Severity.Error, message); } -- GitLab