M3.2: LSP client core (framing, supervision, requests, document sync)

crates/lsp is now a library: Content-Length JSON-RPC framing over stdio
(32 MiB cap, malformed frames dropped and reported, fuzzed), Server::spawn
with initialize/initialized (utf-16, incremental sync, completion, hover,
signatureHelp, definition, references, rename, publishDiagnostics),
typed requests with timeouts and $/cancelRequest, answers to server
requests (configuration nulls, MethodNotFound), events on a bounded
channel, supervision with backoff restarts that reopen documents and
give up after 5 crashes in 2 min, shutdown/exit, and incremental
document sync from lutra_text edits. Tested against a scripted fake
server binary; docs: architecture, G6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-18 00:57:10 +02:00
parent 9ccfc1bf6a
commit 81831c90e0
15 changed files with 4089 additions and 2 deletions

6
Cargo.lock generated
View file

@ -2611,6 +2611,12 @@ dependencies = [
[[package]]
name = "lutra-lsp"
version = "0.0.0"
dependencies = [
"lutra-text",
"proptest",
"serde_json",
"tempfile",
]
[[package]]
name = "lutra-mcp"