feat(runtime+tools): LspRegistry — LSP client dispatch for tool surface

Add LspRegistry in crates/runtime/src/lsp_client.rs and wire it into
run_lsp() tool handler in crates/tools/src/lib.rs.

Runtime additions:
- LspRegistry: register/get servers by language, find server by file
  extension, manage diagnostics, dispatch LSP actions
- LspAction enum (Diagnostics/Hover/Definition/References/Completion/Symbols/Format)
- LspServerStatus enum (Connected/Disconnected/Starting/Error)
- Diagnostic/Location/Hover/CompletionItem/Symbol types for structured responses
- Action dispatch validates server status and path requirements

Tool wiring:
- run_lsp() maps LspInput to LspRegistry.dispatch()
- Supports dynamic server lookup by file extension (rust/ts/js/py/go/java/c/cpp/rb/lua)
- Caches diagnostics across servers

8 new tests covering registration, lookup, diagnostics, and dispatch paths.
Bridges to existing LSP process manager for actual JSON-RPC execution.
This commit is contained in:
Jobdori
2026-04-03 17:46:13 +09:00
parent cc0f92e267
commit 2d665039f8
3 changed files with 461 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ mod conversation;
mod file_ops;
mod hooks;
mod json;
pub mod lsp_client;
mod mcp;
mod mcp_client;
mod mcp_stdio;