|
|
@@ -67,7 +67,11 @@ export class McpHub {
|
|
|
this.initializeMcpServers()
|
|
|
}
|
|
|
|
|
|
- private setupWorkspaceFoldersWatcher(): void {
|
|
|
+ public setupWorkspaceFoldersWatcher(): void {
|
|
|
+ // Skip if test environment is detected
|
|
|
+ if (process.env.NODE_ENV === "test" || process.env.JEST_WORKER_ID !== undefined) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.disposables.push(
|
|
|
vscode.workspace.onDidChangeWorkspaceFolders(async () => {
|
|
|
await this.updateProjectMcpServers()
|
|
|
@@ -230,7 +234,7 @@ export class McpHub {
|
|
|
// Validate configuration structure
|
|
|
const result = McpSettingsSchema.safeParse(config)
|
|
|
if (!result.success) {
|
|
|
- vscode.window.showErrorMessage("项目 MCP 配置格式无效")
|
|
|
+ vscode.window.showErrorMessage("Invalid project MCP configuration format")
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -238,7 +242,7 @@ export class McpHub {
|
|
|
await this.updateServerConnections(result.data.mcpServers || {}, "project")
|
|
|
} catch (error) {
|
|
|
console.error("Failed to initialize project MCP servers:", error)
|
|
|
- vscode.window.showErrorMessage(`初始化项目 MCP 服务器失败: ${error}`)
|
|
|
+ vscode.window.showErrorMessage(`Failed to initialize project MCP server: ${error}`)
|
|
|
}
|
|
|
}
|
|
|
|