Summary
LspServer.HandleMessage parses the payload before entering the try block that catches JsonException. A malformed JSON-RPC frame can therefore throw out of Run and terminate the LSP server loop instead of returning a JSON-RPC parse error or dropping the bad frame.
Evidence
src/CodeIndex/Lsp/LspServer.cs:29 calls HandleMessage(payload) without a surrounding catch.
src/CodeIndex/Lsp/LspServer.cs:39 runs JsonDocument.Parse(payload) before the later try block.
- The catch at
src/CodeIndex/Lsp/LspServer.cs:63 includes JsonException, but parse failures from line 39 never reach it.
Expected
Malformed JSON should be handled inside the LSP message loop and should not terminate the server process.
Summary
LspServer.HandleMessageparses the payload before entering thetryblock that catchesJsonException. A malformed JSON-RPC frame can therefore throw out ofRunand terminate the LSP server loop instead of returning a JSON-RPC parse error or dropping the bad frame.Evidence
src/CodeIndex/Lsp/LspServer.cs:29callsHandleMessage(payload)without a surrounding catch.src/CodeIndex/Lsp/LspServer.cs:39runsJsonDocument.Parse(payload)before the latertryblock.src/CodeIndex/Lsp/LspServer.cs:63includesJsonException, but parse failures from line 39 never reach it.Expected
Malformed JSON should be handled inside the LSP message loop and should not terminate the server process.