Skip to content

Conversation

HerringtonDarkholme
Copy link

The Language Server Protocol requires that all requests receive responses. Previously, ALE would silently ignore unknown JSON-RPC requests from language servers (like workspace/configuration), violating the LSP specification.

Solution:

  • Modified the central message handler in ale#lsp#HandleMessage to track whether any handler processed each message
  • Added handler return values: handlers now return v:true when they process server-initiated requests/notifications
  • Only 2 handlers needed modification since most handle client request responses:
    • ale#lsp_linter#HandleLSPResponse (textDocument/publishDiagnostics, etc.)
    • ale#codefix#HandleLSPResponse (workspace/applyEdit)
  • Unknown requests now receive standard JSON-RPC error responses with code -32601 (Method Not Found)

This ensures ALE is compliant with the LSP specification requirement that "Every processed request must send a response back to the sender."

🤖 Generated with Claude Code

Fixes #4610

I have not added vader test, due to insufficient AI training data. Yet I think this pull request is good enough for an inspiration.

HerringtonDarkholme and others added 2 commits September 4, 2025 18:45
The Language Server Protocol requires that all requests receive responses.
Previously, ALE would silently ignore unknown JSON-RPC requests from language
servers (like workspace/configuration), violating the LSP specification.

Solution:
- Modified the central message handler in ale#lsp#HandleMessage to track
  whether any handler processed each message
- Added handler return values: handlers now return v:true when they process
  server-initiated requests/notifications
- Only 2 handlers needed modification since most handle client request responses:
  * ale#lsp_linter#HandleLSPResponse (textDocument/publishDiagnostics, etc.)
  * ale#codefix#HandleLSPResponse (workspace/applyEdit)
- Unknown requests now receive standard JSON-RPC error responses with code
  -32601 (Method Not Found)

This ensures ALE is compliant with the LSP specification requirement that
"Every processed request must send a response back to the sender."

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
The Language Server Protocol requires that all requests receive responses.
Previously, ALE would silently ignore unknown JSON-RPC requests from language
servers (like workspace/configuration), violating the LSP specification.

Solution:
- Modified the central message handler in ale#lsp#HandleMessage to track
  whether any handler processed each message
- Added handler return values: handlers now return v:true when they process
  server-initiated requests/notifications
- Only 2 handlers needed modification since most handle client request responses:
  * ale#lsp_linter#HandleLSPResponse (textDocument/publishDiagnostics, etc.)
  * ale#codefix#HandleLSPResponse (workspace/applyEdit)
- Unknown requests now receive standard JSON-RPC error responses with code
  -32601 (Method Not Found)

This ensures ALE is compliant with the LSP specification requirement that
"Every processed request must send a response back to the sender."

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@hsanson hsanson requested a review from w0rp September 6, 2025 07:35
@rymdbar rymdbar mentioned this pull request Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unknown json-rpc requests should get an error response, not be ignored
1 participant