-
Notifications
You must be signed in to change notification settings - Fork 904
Description
The LSP spec says [link]
Responses for requests should be sent in the same order as the requests appear on the server or client side. So for example if a server receives a textDocument/completion request and then a textDocument/signatureHelp request it should first return the response for the textDocument/completion and then the response for textDocument/signatureHelp.
How the server internally processes the requests is up to the server implementation. If the server decides to execute them in parallel and this produces correct result the server is free to do so. The server is also allowed to reorder requests and notification if the reordering doesn't affect correctness.
This is confusing -- e.g. ocaml/merlin#607 (comment)
Q. If the client sends textDocument/definition request id 10 followed by textDocument/hover request id 11, is the LSP server permitted to send back response id 11 followed by response id 10 if this still "produces the correct result"?
The spec says the server is able to "reorder requests and notifications if the reordering doesn't affect correctness". I don't know if this means to allow arbitrary re-ordering of requests with respect to each other, or if it's merely to allow re-ordering of notifications with respect to requests.
cc. @freebroccolo