Skip to content

Commit

Permalink
feat(chat): add support for showing output channels in file context (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sma1lboy authored Dec 4, 2024
1 parent ed1260c commit 27f0645
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clients/vscode/src/chat/fileContext.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -63,6 +63,12 @@ export async function getFileContext(
}

export async function showFileContext(fileContext: FileContext, gitProvider: GitProvider): Promise<void> {
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}`);
Expand Down

0 comments on commit 27f0645

Please sign in to comment.