Skip to content

1.0.43

Choose a tag to compare

@morapelker morapelker released this 25 Feb 09:21
· 2980 commits to main since this release

What's Changed

feat: add LSP support for Claude Agent SDK sessions (#65)

Adds Language Server Protocol (LSP) integration so that Claude AI sessions can query language servers for code intelligence — definitions, references, hover info, diagnostics, symbols, call hierarchy, and implementations.

What's included

  • LSP server registry (lsp-servers.ts) — 4 built-in server definitions (TypeScript, Python, Go, Rust) with automatic root detection via marker files and binaryExists safety (execFileSync instead of execSync)
  • LSP client (lsp-client.ts) — JSON-RPC over stdio wrapper using vscode-jsonrpc, handles the initialize/initialized handshake, file open/change notifications, diagnostics collection with debounced waitForDiagnostics, and clean shutdown
  • LSP service (lsp-service.ts) — Manages multiple LSP clients per worktree, auto-starts the correct language server based on file extension, and dispatches all 9 LSP operations (definition, references, hover, diagnostics, documentSymbol, workspaceSymbol, implementation, incomingCalls, outgoingCalls)
  • LSP MCP server (lsp-mcp-server.ts) — Exposes the LSP service as an MCP tool (hive-lsp/lsp) that Claude can invoke during sessions, with Zod-validated input schema
  • Claude Agent SDK integration (claude-code-implementer.ts) — Wires the LSP MCP server into every new Claude session (best-effort), manages LSP service lifecycle per worktree, and shuts down LSP servers when no sessions remain
  • Renderer UI (LspToolView.tsx, ToolCard.tsx) — Rich tool card for LSP operations with syntax-highlighted results, operation-specific coloring, location links, diagnostics severity badges, and compact collapsed view
  • Comprehensive test suite — 7 test files covering types, fake LSP server fixture, client, service, MCP server, and end-to-end integration

New dependencies

  • vscode-jsonrpc ^8.2.1 — JSON-RPC protocol for LSP communication
  • vscode-languageserver-types ^3.17.5 — LSP type definitions
  • zod 3.25.76 — Schema validation for MCP tool inputs

Architecture

Claude Session
  └─ MCP Server (hive-lsp)
       └─ LspService (per worktree)
            └─ LspClient (per language server)
                 └─ Language Server process (stdio)

LSP services are shared across sessions on the same worktree and automatically cleaned up when all sessions disconnect.