mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-13 23:44:09 +01:00
#57618 Fix open log output file action
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user