feat:surfer替换vcdroom

This commit is contained in:
Roe-xin
2026-01-07 17:30:34 +08:00
parent 226bb46094
commit b1dd2442b8
18 changed files with 5634 additions and 162 deletions

View File

@ -1,13 +1,27 @@
import * as vscode from "vscode";
import { ICViewProvider } from "./views/ICViewProvider";
import { showICHelperPanel } from "./panels/ICHelperPanel";
import { VCDViewerPanel } from "./panels/VCDViewerPanel";
import { VCDViewerPanel, VCDViewerEditorProvider } from "./panels/VCDViewerPanel";
import { ChatHistoryManager } from "./utils/chatHistoryManager";
import { ICCoderAuthenticationProvider } from "./services/icCoderAuthProvider";
import { VCDFileServer } from "./services/vcdFileServer";
export function activate(context: vscode.ExtensionContext) {
console.log("🎉 IC Coder 插件已激活!");
// 初始化 VCD 文件服务器
const vcdFileServer = new VCDFileServer();
vcdFileServer.start().then((port) => {
console.log(`VCD 文件服务器已启动,端口: ${port}`);
}).catch((error) => {
console.error("启动 VCD 文件服务器失败:", error);
});
// 在插件停用时关闭服务器
context.subscriptions.push({
dispose: () => vcdFileServer.stop()
});
// 注册 Authentication Provider
const authProvider = new ICCoderAuthenticationProvider(context);
context.subscriptions.push(
@ -68,7 +82,7 @@ export function activate(context: vscode.ExtensionContext) {
}
}
VCDViewerPanel.createOrShow(context.extensionUri, vcdFilePath);
VCDViewerPanel.createOrShow(context.extensionUri, vcdFilePath, vcdFileServer);
}
);
@ -160,6 +174,9 @@ export function activate(context: vscode.ExtensionContext) {
viewProvider
);
// 注册 VCD 自定义编辑器
const vcdEditorProvider = VCDViewerEditorProvider.register(context);
// 添加到订阅
context.subscriptions.push(
openPanelCommand,
@ -174,7 +191,8 @@ export function activate(context: vscode.ExtensionContext) {
// deleteSessionCommand,
// clearHistoryCommand,
// searchSessionCommand,
viewRegistration
viewRegistration,
vcdEditorProvider
);
}