-
Notifications
You must be signed in to change notification settings - Fork 248
Unrecognized LSP requests are silently dropped instead of returning MethodNotFound (-32601) #3981
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workinggood-first-issueGood for newcomersGood for newcomershelp-wantedExtra attention is neededExtra attention is neededpinnedThis issue or pull request is pinned and won't be marked as staleThis issue or pull request is pinned and won't be marked as stale
Description
The process_message case statement in lib/ruby_lsp/server.rb has no else clause, so when the server receives a request for an unsupported method (e.g. textDocument/prepareCallHierarchy), it matches no branch, returns nil, and never sends a response. The LSP spec requires servers to respond to any request bearing an id — for unsupported methods, that's error code -32601 (MethodNotFound). The silent drop causes well-behaved clients to hang indefinitely waiting for a response. Adding an else branch that calls send_message(Error.new(id: message[:id], code: -32601, message: "Method not found: #{message[:method]}")) when message[:id] is present would fix it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood-first-issueGood for newcomersGood for newcomershelp-wantedExtra attention is neededExtra attention is neededpinnedThis issue or pull request is pinned and won't be marked as staleThis issue or pull request is pinned and won't be marked as stale
Type
Fields
Give feedbackNo fields configured for issues without a type.