-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset CompletionState when textDocument/completion gets an ResponseError #131
Comments
The problem is caused by a very general one. If ANY request is responded with a server error -32000 the response handler is never called. Therefore the CompletionHandler's response_handler in this case is never called. The error response seems not to include the request id? Therefore the CompletionHandler gets caught in CANCALLING state and can't recover. |
There is some requirement that responses arrive in the same order that the requests are made: microsoft/language-server-protocol#12 How common should it be for completion requests to return an error? Errors should be shown in the status bar already, the user can always @randy3k, what language server is returning the error, and what is the error returned? |
I encountered the error when developing the R language server. They are runtime errors due to bugs in completion handler where |
Closing and reopening the view should set up a new Let me know if that is not a functional or acceptable workaround for what should be rare or development-time language server errors. |
No software is perfect. We always should assume something to possibly go wrong. Therefore I think LSP should handle error responses somehow and in this case really cancel the completion. How should a normal user find out why completions suddenly stopped working? I was indeed wondering for a while, too, until I found the error responses to be the reason. See the ' But with the assumption of ordered request/response chains, this issue might be solved by adding some kind of fifo and remember all sent requests until the corresponding response was received to catch errors as well and forward them to the response handlers. |
I am with @deathaxe. I think in general we need to pass the responses to the corresponding handler without catching them too early. It is not a solution at all to re-open the document if it can be avoided. |
Yep, we can keep this issue for later. |
I thought #140 and this are caused by the same bug. |
You are correct, but this bug can have many cases in the future and needs to be fixed separately in the future. |
Yes this is a more general issue. This topic is just an example. I guess it needs some time to work out a strategy and may cause bigger changes to solve this issue cleanly. |
We need to reset
CompletionState
toIDLE
, otherwise, autocompletion will be frozen.The text was updated successfully, but these errors were encountered: