feat(host-internal): 多语言 LSP 接入与 get_diagnostics 动态工具描述#71
Conversation
扩展 provider 目录与按文件后缀路由,并将 PATH 解析抽象为通用 resolveCommandOnPath;运行时仍仅探测 TypeScript 语言服务器。
新增 LspProviderSession 与 LspOrchestrator,LspService 改为门面;TypeScript 端到端行为保持不变。
注册 pyright、gopls PATH 解析与 install 模块(npm/go),Desktop 安装命令改用统一 installLspProvider。
注册 rust-analyzer、clangd PATH 解析,扩展 languageId 映射;clangd 安装仍走平台包管理器指引。
jdtls 使用 Java 21+ 自定义启动器与工作区 data 目录;OmniSharp 支持 PATH 与 dotnet+dll 回退。
扩展 LSP 支持后缀与工具描述,get_diagnostics 与写后 append 按后缀自动路由到已安装语言服务器。
更新 agent-core/host 边界说明;Desktop LSP 快照支持 installKind,仅对 npm/go/rustup 显示一键安装。
合并工具定义时传入 probe 后就绪的 provider 列表,避免模型误以为未安装语言也可用
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 00f8d3e. Configure here.
|
|
||
| const resolvedPath = resolvedPathFromWriteRequest(lsp.workspaceRoot, request); | ||
| if (!resolvedPath || !isTypescriptJavascriptPath(resolvedPath)) { | ||
| if (!resolvedPath || !isLspSupportedPath(resolvedPath)) { |
There was a problem hiding this comment.
Write append masks missing server
Medium Severity
After a successful write, post-edit LSP append now runs for every in-scope extension, not only TypeScript/JavaScript. When the matching language server was never probed as ready, getDiagnosticsForPath fails, and the broad catch still appends “diagnostics pending or timed out,” which misleads the model about a missing server versus a slow analysis.
Reviewed by Cursor Bugbot for commit 00f8d3e. Configure here.
hasReadyProviderForPath 过滤未 probe 就绪的后缀;catch 仅对 LspTimeoutError 追加 pending 文案,避免无 server 被误判为慢分析。


Summary
LspOrchestrator+LspProviderSession),按文件后缀路由至 typescript-language-server、Pyright、gopls、rust-analyzer、clangd、jdtls、OmniSharp。get_diagnostics工具描述按当前 probe 就绪的 provider 动态生成,避免模型误以为未安装语言可用;不写 HTML/CSS 负向提示。Test plan
npm run buildnpm --prefix packages/host-internal run test:lsp(含 orchestrator、ready-providers、install)npm --prefix apps/desktop run test:hosteval:compare