40 lines
1009 B
TypeScript
40 lines
1009 B
TypeScript
import * as vscode from "vscode";
|
|
import { ICViewProvider } from "./views/ICViewProvider";
|
|
import { showICHelperPanel } from "./panels/ICHelperPanel";
|
|
|
|
export function activate(context: vscode.ExtensionContext) {
|
|
console.log("🎉 IC Coder 插件已激活!");
|
|
|
|
// 注册命令:打开助手面板
|
|
const openPanelCommand = vscode.commands.registerCommand(
|
|
"ic-coder.openPanel",
|
|
() => {
|
|
showICHelperPanel(context);
|
|
}
|
|
);
|
|
|
|
// 注册命令:打开聊天(用于侧边栏)
|
|
const openChatCommand = vscode.commands.registerCommand(
|
|
"ic-coder.openChat",
|
|
() => {
|
|
showICHelperPanel(context);
|
|
}
|
|
);
|
|
|
|
// 注册侧边栏视图
|
|
const viewProvider = new ICViewProvider(context.extensionUri);
|
|
const viewRegistration = vscode.window.registerWebviewViewProvider(
|
|
"ic-coder.mainView",
|
|
viewProvider
|
|
);
|
|
|
|
// 添加到订阅
|
|
context.subscriptions.push(
|
|
openPanelCommand,
|
|
openChatCommand,
|
|
viewRegistration
|
|
);
|
|
}
|
|
|
|
export function deactivate() {}
|