Skip to content

Commit 8d0c573

Browse files
committed
microsoft#57618 Fix open log output file action
1 parent 5215f23 commit 8d0c573

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/vs/workbench/parts/output/browser/outputActions.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
2020
import { Registry } from 'vs/platform/registry/common/platform';
2121
import { groupBy } from 'vs/base/common/arrays';
2222
import { ICommandService } from 'vs/platform/commands/common/commands';
23+
import { URI } from 'vs/base/common/uri';
2324

2425
export class ToggleOutputAction extends TogglePanelAction {
2526

@@ -179,16 +180,16 @@ export class OpenLogOutputFile extends Action {
179180
}
180181

181182
private update(): void {
182-
this.enabled = this.isLogChannel();
183+
this.enabled = !!this.getLogFile();
183184
}
184185

185186
public run(): TPromise<any> {
186-
return this.commandService.executeCommand(COMMAND_OPEN_LOG_VIEWER, this.isLogChannel());
187+
return this.commandService.executeCommand(COMMAND_OPEN_LOG_VIEWER, this.getLogFile());
187188
}
188189

189-
private isLogChannel(): boolean {
190+
private getLogFile(): URI {
190191
const channel = this.outputService.getActiveChannel();
191192
const descriptor = channel ? this.outputService.getChannelDescriptors().filter(c => c.id === channel.id)[0] : null;
192-
return descriptor && descriptor.log;
193+
return descriptor && descriptor.log ? descriptor.file : null;
193194
}
194195
}

0 commit comments

Comments
 (0)