#57618 Fix open log output file action

This commit is contained in:
Sandeep Somavarapu
2018-09-04 18:02:18 +02:00
parent 5215f2379d
commit 8d0c573bf5
@@ -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<any> {
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;
}
}