Skip to content

Commit 1f09174

Browse files
committed
fix(mpp-vscode): remove unused variables
- Remove unused JsCompressionConfig import in mpp-core.ts - Remove unused basePath variable in chat-view.ts - Remove unused nonce variable and getNonce method in chat-view.ts
1 parent aceaf34 commit 1f09174

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

mpp-vscode/src/bridge/mpp-core.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
import MppCore from '@autodev/mpp-core';
1010

1111
// Access the exported Kotlin/JS classes
12-
const {
13-
JsKoogLLMService,
14-
JsModelConfig,
12+
const {
13+
JsKoogLLMService,
14+
JsModelConfig,
1515
JsMessage,
1616
JsModelRegistry,
1717
JsCompletionManager,
1818
JsDevInsCompiler,
19-
JsToolRegistry,
20-
JsCompressionConfig
19+
JsToolRegistry
2120
} = MppCore.cc.unitmesh.llm;
2221

2322
const { JsCodingAgent, JsAgentTask } = MppCore.cc.unitmesh.agent;

mpp-vscode/src/providers/chat-view.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,6 @@ User's original prompt:`;
658658
return;
659659
}
660660

661-
const basePath = workspaceFolders[0].uri.fsPath;
662661
const lowerQuery = query.toLowerCase();
663662

664663
// Search for files matching the query
@@ -880,9 +879,6 @@ User's original prompt:`;
880879
const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(webviewPath, 'assets', 'index.js'));
881880
const styleUri = webview.asWebviewUri(vscode.Uri.joinPath(webviewPath, 'assets', 'index.css'));
882881

883-
// Use nonce for security
884-
const nonce = this.getNonce();
885-
886882
// Try to use React build, fallback to inline HTML
887883
return `<!DOCTYPE html>
888884
<html lang="en">
@@ -968,14 +964,5 @@ User's original prompt:`;
968964
</body>
969965
</html>`;
970966
}
971-
972-
private getNonce(): string {
973-
let text = '';
974-
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
975-
for (let i = 0; i < 32; i++) {
976-
text += possible.charAt(Math.floor(Math.random() * possible.length));
977-
}
978-
return text;
979-
}
980967
}
981968

0 commit comments

Comments
 (0)