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; } }