@@ -62,7 +62,6 @@ export class ChatPanel {
6262 this . panel . webview . html = this . getHtmlForWebview ( ) ;
6363 }
6464
65- // ==================== 公共静态方法 ====================
6665 public static createOrShow ( context : vscode . ExtensionContext ) : void {
6766 const column = vscode . window . activeTextEditor ?. viewColumn ;
6867
@@ -81,7 +80,6 @@ export class ChatPanel {
8180 ChatPanel . currentPanel = new ChatPanel ( panel , context ) ;
8281 }
8382
84- // ==================== 私有方法 - 初始化 ====================
8583 private setupPanelEventListeners ( ) : void {
8684 this . panel . onDidDispose ( ( ) => this . dispose ( ) , null , this . disposables ) ;
8785 this . panel . webview . onDidReceiveMessage (
@@ -91,7 +89,6 @@ export class ChatPanel {
9189 ) ;
9290 }
9391
94- // ==================== 私有方法 - HTML 生成 ====================
9592 private getHtmlForWebview ( ) : string {
9693 return `
9794 <!DOCTYPE html>
@@ -187,12 +184,10 @@ export class ChatPanel {
187184 // 加载外部脚本
188185 const script = document.createElement('script');
189186 script.src = '${ scriptUri } ';
190- //script.onload = initializeWebview;
191187 document.body.appendChild(script);
192188 ` ;
193189 }
194190
195- // ==================== 私有方法 - 消息处理 ====================
196191 private async handleMessage ( message : any ) : Promise < void > {
197192 const webviewOutputChannel = new WebviewOutputChannel ( this . panel . webview , 'DeepSeek API Output' ) ;
198193
@@ -306,7 +301,6 @@ export class ChatPanel {
306301 } ) ;
307302 }
308303
309- // ==================== 私有方法 - 文件操作 ====================
310304 private saveChatToFile ( ) : void {
311305 if ( ! this . chatFilePath || Date . now ( ) - this . lastSaveTime < 10000 ) {
312306 return ;
@@ -330,7 +324,6 @@ export class ChatPanel {
330324 }
331325 }
332326
333- // ==================== 清理方法 ====================
334327 public dispose ( ) : void {
335328 ChatPanel . currentPanel = undefined ;
336329 this . panel . dispose ( ) ;
0 commit comments