-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathextension.ts
More file actions
46 lines (43 loc) · 1.94 KB
/
Copy pathextension.ts
File metadata and controls
46 lines (43 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import * as vscode from "vscode";
import { GrokSidebar } from "./sidebar";
export function activate(context: vscode.ExtensionContext): void {
const output = vscode.window.createOutputChannel("Grok");
const sidebar = new GrokSidebar(context, output);
context.subscriptions.push(
vscode.window.registerWebviewViewProvider(GrokSidebar.viewId, sidebar, {
webviewOptions: { retainContextWhenHidden: true },
}),
output,
{ dispose: () => sidebar.dispose() },
vscode.commands.registerCommand("grok.open", () =>
vscode.commands.executeCommand("workbench.view.extension.grokSidebar"),
),
vscode.commands.registerCommand("grok.newSession", () => sidebar.newSession()),
vscode.commands.registerCommand("grok.compact", () => {
// emulated by sending the slash command as a prompt; CLI handles it
vscode.window.showInformationMessage(
"Type /compact in the composer to compress the conversation.",
);
}),
vscode.commands.registerCommand("grok.pickModel", () => sidebar.pickModel()),
vscode.commands.registerCommand("grok.toggleMode", () => sidebar.openModePopover()),
vscode.commands.registerCommand("grok.sendSelection", () =>
sidebar.insertActiveMention({ selection: true }),
),
vscode.commands.registerCommand(
"grok.sendFile",
(uri?: vscode.Uri) => sidebar.insertActiveMention({ uri }),
),
vscode.commands.registerCommand("grok.insertAtMention", () =>
sidebar.insertActiveMention(),
),
vscode.commands.registerCommand("grok.showLogs", () => output.show()),
vscode.commands.registerCommand("grok.logout", () => sidebar.logout()),
// Internal debug helper for manually exercising the plan-review card UI
// (Approve / Reject / Cancel flows) without a live CLI session.
vscode.commands.registerCommand("grok._debugDummyPlan", () => sidebar.debugShowDummyPlan()),
);
}
export function deactivate(): void {
// disposables handle cleanup
}