From 8d0c573bf5c2f760cf3f103669c8ade747e209eb Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 4 Sep 2018 18:02:18 +0200 Subject: [PATCH] #57618 Fix open log output file action --- src/vs/workbench/parts/output/browser/outputActions.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/parts/output/browser/outputActions.ts b/src/vs/workbench/parts/output/browser/outputActions.ts index 8190d5131a0..ed4d811c127 100644 --- a/src/vs/workbench/parts/output/browser/outputActions.ts +++ b/src/vs/workbench/parts/output/browser/outputActions.ts @@ -20,6 +20,7 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView import { Registry } from 'vs/platform/registry/common/platform'; import { groupBy } from 'vs/base/common/arrays'; import { ICommandService } from 'vs/platform/commands/common/commands'; +import { URI } from 'vs/base/common/uri'; export class ToggleOutputAction extends TogglePanelAction { @@ -179,16 +180,16 @@ export class OpenLogOutputFile extends Action { } private update(): void { - this.enabled = this.isLogChannel(); + this.enabled = !!this.getLogFile(); } public run(): TPromise { - return this.commandService.executeCommand(COMMAND_OPEN_LOG_VIEWER, this.isLogChannel()); + return this.commandService.executeCommand(COMMAND_OPEN_LOG_VIEWER, this.getLogFile()); } - private isLogChannel(): boolean { + private getLogFile(): URI { const channel = this.outputService.getActiveChannel(); const descriptor = channel ? this.outputService.getChannelDescriptors().filter(c => c.id === channel.id)[0] : null; - return descriptor && descriptor.log; + return descriptor && descriptor.log ? descriptor.file : null; } } -- GitLab