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

View file

@ -11,7 +11,19 @@ publish.workspace = true
[package.metadata.lutra]
layer = 3
[[bin]]
name = "lutra-lsp-fake"
path = "src/bin/lutra-lsp-fake.rs"
test = false
doc = false
[dependencies]
lutra-text.workspace = true
serde_json = "1.0.154"
[dev-dependencies]
proptest.workspace = true
tempfile.workspace = true
[lints]
workspace = true