提交 8d0c573b 编写于 作者: S Sandeep Somavarapu

#57618 Fix open log output file action

上级 5215f237
......@@ -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;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册