From 27f0645ef7a32dccff74d27ea14c89572fdf2916 Mon Sep 17 00:00:00 2001 From: Jackson Chen <90215880+Sma1lboy@users.noreply.github.com> Date: Wed, 4 Dec 2024 01:37:04 -0600 Subject: [PATCH] feat(chat): add support for showing output channels in file context (#3507) --- clients/vscode/src/chat/fileContext.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clients/vscode/src/chat/fileContext.ts b/clients/vscode/src/chat/fileContext.ts index 6f193dad79a3..06b118ff2c4b 100644 --- a/clients/vscode/src/chat/fileContext.ts +++ b/clients/vscode/src/chat/fileContext.ts @@ -1,7 +1,7 @@ import type { TextEditor, TextDocument } from "vscode"; import type { FileContext } from "tabby-chat-panel"; import type { GitProvider } from "../git/GitProvider"; -import { workspace, window, Position, Range, Selection, TextEditorRevealType, Uri, ViewColumn } from "vscode"; +import { workspace, window, Position, Range, Selection, TextEditorRevealType, Uri, ViewColumn, commands } from "vscode"; import path from "path"; import { getLogger } from "../logger"; @@ -63,6 +63,12 @@ export async function getFileContext( } export async function showFileContext(fileContext: FileContext, gitProvider: GitProvider): Promise { + if (fileContext.filepath.startsWith("output:")) { + const channelId = Uri.parse(fileContext.filepath).fsPath; + await commands.executeCommand(`workbench.action.output.show.${channelId}`); + return; + } + const document = await openTextDocument(fileContext, gitProvider); if (!document) { throw new Error(`File not found: ${fileContext.filepath}`);