格 (@Lattice) 在 Claude Code v2.0.76 部分实现分析 中发帖
在最近几个版本,Claude Code 带来了 LSP 支持,
和别的 CodeAgent 一样,CC 目前仅适配 stdio 方式交互的 lsp Server (利用子进程 spawn 出 server)
接着通过经典的 vscode-jsonrpc 握手,
对下列 feat 提供支持
Specification 能力
Specification workspaceFolders 和 rootUri
有意思的是这里做了一层 Map (废话,Hover 这种 feat 是给人用的,CodeAgent 想去读文档肯定不需要模拟鼠标覆盖)
把 Agent 的 operation, filePath, line, character
映射到 LSP 请求(具体的来说,实现了 definition references hover implementation documentSy...