Skip to content

Commit eba71b0

Browse files
authored
Add command to show output channel from debug tree view (#1168)
1 parent ba4e28c commit eba71b0

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,6 +1989,11 @@
19891989
"title": "%github.copilot.command.showChatLogView%",
19901990
"category": "Developer"
19911991
},
1992+
{
1993+
"command": "github.copilot.debug.showOutputChannel",
1994+
"title": "%github.copilot.command.showOutputChannel%",
1995+
"category": "Developer"
1996+
},
19921997
{
19931998
"command": "github.copilot.debug.showContextInspectorView",
19941999
"title": "%github.copilot.command.showContextInspectorView%",
@@ -3370,6 +3375,10 @@
33703375
{
33713376
"command": "github.copilot.chat.debug.showRawRequestBody",
33723377
"when": "false"
3378+
},
3379+
{
3380+
"command": "github.copilot.debug.showOutputChannel",
3381+
"when": "false"
33733382
}
33743383
],
33753384
"view/title": [
@@ -3388,6 +3397,11 @@
33883397
"when": "view == copilot-chat",
33893398
"group": "export@1"
33903399
},
3400+
{
3401+
"command": "github.copilot.debug.showOutputChannel",
3402+
"when": "view == copilot-chat",
3403+
"group": "3_show@1"
3404+
},
33913405
{
33923406
"command": "github.copilot.debug.showChatLogView",
33933407
"when": "view == workbench.panel.chat.view.copilot",

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
},
8080
"github.copilot.command.logWorkbenchState": "Log Workbench State",
8181
"github.copilot.command.showChatLogView": "Show Chat Debug View",
82+
"github.copilot.command.showOutputChannel": "Show Output Channel",
8283
"github.copilot.command.showContextInspectorView": "Inspect Language Context",
8384
"github.copilot.command.resetVirtualToolGroups": "Reset Virtual Tool Groups",
8485
"github.copilot.command.applySuggestionWithCopilot": "Apply Suggestion",

src/extension/log/vscode-node/requestLogTree.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import * as path from 'path';
1111
import * as tar from 'tar';
1212
import * as vscode from 'vscode';
1313
import { IVSCodeExtensionContext } from '../../../platform/extContext/common/extensionContext';
14+
import { OutputChannelName } from '../../../platform/log/vscode/outputChannelLogTarget';
1415
import { ChatRequestScheme, ILoggedElementInfo, ILoggedRequestInfo, ILoggedToolCall, IRequestLogger, LoggedInfo, LoggedInfoKind, LoggedRequestKind } from '../../../platform/requestLogger/node/requestLogger';
1516
import { assertNever } from '../../../util/vs/base/common/assert';
1617
import { Disposable, toDisposable } from '../../../util/vs/base/common/lifecycle';
@@ -498,6 +499,11 @@ export class RequestLogTree extends Disposable implements IExtensionContribution
498499

499500
await vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(ChatRequestScheme.buildUri({ kind: 'request', id: requestId }, 'rawrequest')));
500501
}));
502+
503+
this._register(vscode.commands.registerCommand('github.copilot.debug.showOutputChannel', async () => {
504+
// Yes this is the correct auto-generated command for our output channel
505+
await vscode.commands.executeCommand(`workbench.action.output.show.GitHub.copilot-chat.${OutputChannelName}`);
506+
}));
501507
}
502508
}
503509

src/platform/log/vscode/outputChannelLogTarget.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import { ILogTarget } from '../common/logService';
88

99
export let outputChannel: OutputChannel;
1010

11+
export const OutputChannelName = 'GitHub Copilot Chat';
12+
1113
export class NewOutputChannelLogTarget implements ILogTarget {
1214

13-
private readonly _outputChannel = window.createOutputChannel('GitHub Copilot Chat', { log: true });
15+
private readonly _outputChannel = window.createOutputChannel(OutputChannelName, { log: true });
1416

1517
constructor(extensionContext: ExtensionContext) {
1618
outputChannel = this._outputChannel;

0 commit comments

Comments
 (0)