-
Notifications
You must be signed in to change notification settings - Fork 173
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
LSP server crash can leave the extension in a stuck state #1766
Comments
Thank you for the bug report! For surfacing nicer Bundler errors, we have this issue #1769. I think we can add a custom error handler and do a much better job of showing what went wrong. Regarding restarting the server, it's interesting that the state is not a part of the We need to figure out how we can determine that the client is in the |
I have this issue too in Os X. Uninstall / reinstall / restart computer didn't fix it. EDIT: This is a better solution. I had to do this:
Or to keep it running in the background:
in a terminal window. |
Unless I'm missing something, if you run the server in the background with The extension has no knowledge that the process is running from the terminal nor does it have ownership over the STDIN, STDERR and STDOUT pipes to communicate with it. That's just running bundle install for the custom bundle with the background process and then the extension spawns a second process (owned by the extension) and boots the server. If you inspect the processes for ps aux | grep ruby-lsp |
No, I just see processes for I'm not sure how that's equivalent to it running Whether I call That said, I finally got it to work properly:
|
As part of launching the server, we set up a custom bundle under the If you run Anyway, I'm glad it's fixed. |
This worked for me just now. After upgrading from Ruby |
I believe this has been fixed in recent versions of the extension. Please let us know if that's not the case. |
Yes, I think you are right. I can't actually remember the last time I ran into this. I guess there was some critical part where it really shouldn't have crashed and now it doesn't. |
Operating System
Windows 11
Ruby version
3.2.2
Project has a bundle
Ruby version manager being used
rbenv
Description
There are a few issues here I believe:
When using a custom gemfile and that gemfile gets updated the server crashes. The required gems are not installed => it can't start up anymore. This is documented in the readme:
That error message isn't nicely surfaced however, you need to look in the extension output instead. Related to/Same as #1769 I would say.
However, through that crash the LSP client gets the internal state
startFailed
, which results in the Restart/Stop/Start commands not working even after the issues has been fixed. You have to perform a Window reload instead:Restart (logged to output only):
Start/Stop:
This happens because through some codepath they all end up calling
dispose
. This fails because there is no active connection:https://github.com/microsoft/vscode-languageserver-node/blob/c0982bf544bab9600df223146dd75c93c9004dc3/client/src/common/client.ts#L1374-L1376
I looked through the public API but didn't immediatly find something that would hint to that being the case. The exposed client states are also more limited to than what vscode works with internally (
state
vs$state
which is private)The text was updated successfully, but these errors were encountered: