fix(lsp): replied to defined server requests with spec no-ops

handleServerRequest fell through to a JSON-RPC -32601 Method not found for several defined server -> client requests (window/showMessageRequest, window/showDocument, workspace/{semanticTokens,inlayHint,codeLens,codeAction,diagnostic}/refresh). Servers that block on a real reply -- the same failure class as the client/registerCapability hang fixed in #3029 -- could stall waiting for an acknowledgement that never came.

Reply with the spec no-op result instead: null for showMessageRequest / *Refresh, { success: false } for showDocument. Headless omp cannot honour the UI surface, but it still owes a defined response.

Fixes #3044
This commit is contained in:
roboomp
2026-06-19 10:11:54 +00:00
parent 492fe5e896
commit ef901ecb0d
3 changed files with 87 additions and 0 deletions
+22
View File
@@ -482,6 +482,28 @@ async function handleServerRequest(client: LspClient, message: LspJsonRpcRequest
await sendResponse(client, message.id, null, message.method);
return;
}
if (message.method === "window/showMessageRequest") {
// Headless: no UI to surface the prompt. Spec says null = "no action selected".
await sendResponse(client, message.id, null, message.method);
return;
}
if (message.method === "window/showDocument") {
// Headless: nothing to display. Spec result is `{ success: boolean }`.
await sendResponse(client, message.id, { success: false }, message.method);
return;
}
if (
message.method === "workspace/semanticTokens/refresh" ||
message.method === "workspace/inlayHint/refresh" ||
message.method === "workspace/codeLens/refresh" ||
message.method === "workspace/codeAction/refresh" ||
message.method === "workspace/diagnostic/refresh"
) {
// Void acknowledgement per spec; servers that stall waiting for a reply
// (same failure mode as the dynamic-registration hang in #3029) move on.
await sendResponse(client, message.id, null, message.method);
return;
}
await sendResponse(client, message.id, null, message.method, {
code: -32601,
message: `Method not found: ${message.method}`,