Follow-up from the comprehensive review of PR #239 (LSP server). Line numbers reference the PR branch at review time.
Severity: minor (1-4), nit (5-8) — LSP 3.17 conformance polish in apps/lsp. None of these break mainstream clients today.
- Second
shutdown answered OK (server.rs:188): the Shutdown arm precedes the shutting_down guard arm, so a repeated shutdown gets a second successful null response; spec says requests after shutdown error with InvalidRequest (the server's own doc comment at 173-175 claims as much).
- InitializeParams deserialized after the handshake succeeds (
main.rs:52): connection.initialize(...) completes the handshake and returns raw params; only then does serde_json::from_value::<InitializeParams> run — a wrongly-typed field (e.g. fractional processId; lsp-types declares Option<u32>) kills the server post-handshake instead of failing the initialize request.
- Hover ignores
textDocument.hover.contentFormat (convert.rs:142): always Markdown; plaintext-only clients render fences/backticks literally. The server already reads client capabilities — pick plaintext when markdown is absent.
- Out-of-range inlay-hint request range disables clipping instead of clamping (
handlers.rs:135): convert::text_range returns None for an end one line past EOF, and None means "no clip" in inlay_hints.rs:80 — hints outside the requested window are returned. Clamp like positions elsewhere.
did_close for an unmappable URI still publishes an empty diagnostics set and triggers the dependents sweep (handlers.rs:189), contradicting the module contract ("no diagnostics" for unmappable URIs); did_open honors it.
- Repeated mid-session
initialize falls through to MethodNotFound with the misleading message "unsupported request: initialize" (server.rs:70).
- No
serverInfo in InitializeResult (main.rs:51) — lsp-server 0.8 Connection::initialize hardcodes the body; clients use it in logs/crash reports.
- Oversized
Content-Length causes unbounded pre-allocation in lsp-server 0.8's read_msg_text (buf.resize(size, 0), no cap) — OOM-abort angle adjacent to the documented malformed-frame limitation (main.rs:49). Upstream, but worth bounding or documenting.
Follow-up from the comprehensive review of PR #239 (LSP server). Line numbers reference the PR branch at review time.
Severity: minor (1-4), nit (5-8) — LSP 3.17 conformance polish in
apps/lsp. None of these break mainstream clients today.shutdownanswered OK (server.rs:188): the Shutdown arm precedes theshutting_downguard arm, so a repeated shutdown gets a second successful null response; spec says requests after shutdown error withInvalidRequest(the server's own doc comment at 173-175 claims as much).main.rs:52):connection.initialize(...)completes the handshake and returns raw params; only then doesserde_json::from_value::<InitializeParams>run — a wrongly-typed field (e.g. fractionalprocessId; lsp-types declaresOption<u32>) kills the server post-handshake instead of failing the initialize request.textDocument.hover.contentFormat(convert.rs:142): always Markdown; plaintext-only clients render fences/backticks literally. The server already reads client capabilities — pick plaintext when markdown is absent.handlers.rs:135):convert::text_rangereturns None for an end one line past EOF, and None means "no clip" ininlay_hints.rs:80— hints outside the requested window are returned. Clamp like positions elsewhere.did_closefor an unmappable URI still publishes an empty diagnostics set and triggers the dependents sweep (handlers.rs:189), contradicting the module contract ("no diagnostics" for unmappable URIs);did_openhonors it.initializefalls through to MethodNotFound with the misleading message "unsupported request: initialize" (server.rs:70).serverInfoin InitializeResult (main.rs:51) — lsp-server 0.8Connection::initializehardcodes the body; clients use it in logs/crash reports.Content-Lengthcauses unbounded pre-allocation in lsp-server 0.8'sread_msg_text(buf.resize(size, 0), no cap) — OOM-abort angle adjacent to the documented malformed-frame limitation (main.rs:49). Upstream, but worth bounding or documenting.