feat: 添加 LSP 代码诊断功能

- 实现 LSP 客户端,支持与语言服务器通信
- 支持多种语言: TypeScript, Python, Go, Rust, C/C++ 等
- write_file/edit_file 工具集成 LSP 诊断,写入后自动检查代码错误
- 添加 CLI 命令管理语言服务器 (ai-assist lsp list/install/info)
- 智能等待机制:首次启动 LSP 等待 2s,后续仅需 300ms
- 将 read_file/write_file/edit_file 设为核心工具,确保文件操作使用正确的工具
- 更新系统提示词,引导 AI 使用文件工具而非 bash 命令
This commit is contained in:
2025-12-11 00:01:58 +08:00
parent 1e0ecc2de7
commit 929f6f7850
12 changed files with 1430 additions and 5 deletions
+2
View File
@@ -31,6 +31,8 @@
"inquirer": "^12.0.0",
"ora": "^8.1.0",
"tree-sitter-bash": "^0.25.1",
"vscode-jsonrpc": "^8.2.1",
"vscode-languageserver-protocol": "^3.17.5",
"web-tree-sitter": "^0.25.10",
"zod": "^4.1.13"
},