Skip to content
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 status stuck even though the LSP server is restarted #175

Closed
cenk1cenk2 opened this issue Oct 29, 2022 · 5 comments · Fixed by #639
Closed

LSP status stuck even though the LSP server is restarted #175

cenk1cenk2 opened this issue Oct 29, 2022 · 5 comments · Fixed by #639
Labels
bug Something isn't working question Further information is requested

Comments

@cenk1cenk2
Copy link

cenk1cenk2 commented Oct 29, 2022

Thank you @folke for your all work on many plugins that I dearly enjoy!

Describe the bug
LSP status gets stuck whenever there is a error coming from the language server, even though the language server has been restarted.

Which version of Neovim are you using?
Nightly

To Reproduce
Steps to reproduce the behavior:

  1. On a golang project, manipulate the go.mod file to make the language server throw an error.
  2. Tidy the vendor files.
  3. Restart the LSP language server.

Expected Behavior
Language server should go away whenever the LSP is restarted.

Screenshots
image

Noice Log
Please include any related errors from the Noice log file. (open with :Noice log)

Noice log
Nothing related, since everything works as expected in the UI form.
@folke
Copy link
Owner

folke commented Nov 7, 2022

I'm not a Go developer, so you'll need to be more specific in how I can reproduce this error.

@folke folke added the question Further information is requested label Nov 7, 2022
@cenk1cenk2
Copy link
Author

cenk1cenk2 commented Nov 7, 2022

That is totally okay, thanks for your time @folke, I would try to do my best on explaining this further.

As I understand it, the issue is compared to other language servers gopls sends out an exit code that is not 0 when LspRestart request comes in, it does not start in place the existing instance so neovim restarts manually.

image

When the go.mod file is updated manually, there is an implicit error raised by the language server where it says that the mod file is out of date. Noice as expected propagates this issue to the user through the UI.
image

But when the language server is explicitly reloaded to reflect the changes on the mod file, by tidying the mod file therefore reinstalling the dependencies, it does not pick this automatically so it needs to be restarted.

Even though the language server works properly after being restarted, Noice still picks up the error from the old instance indefinitely, causing the neovim to slow down and constantly show the given message.

I do not think this issue affects many language servers, because this is not the usual flow.

@cenk1cenk2
Copy link
Author

If you have golang installed, you can reproduce it as follows:

  1. Please pull the repository: https://gitlab.kilic.dev/docker/seafile-cli
  2. make install to get the dependencies first.
  3. Open up file go.mod
  4. Change version of gitlab.kilic.dev/libraries/plumber/v4 v4.16.0 manually to v4.15.0
  5. You should see the language server error now.
  6. make tidy to tidy and install your overwritten version
  7. :LspRestart to fix the language server.
  8. The error should be stuck but the language server should now work properly.

@folke folke closed this as completed in e084d3b Nov 7, 2022
@folke
Copy link
Owner

folke commented Nov 7, 2022

Should be fixed now. Let me know if you have any more issues.

@cenk1cenk2
Copy link
Author

Thanks, @folke, I can confirm this fixes the related issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants