nvim-lua / lsp-status.nvim

Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
MIT License
621 stars 41 forks source link

Stopping an LSP makes the editor unusable #74

Open WhyNotHugo opened 2 years ago

WhyNotHugo commented 2 years ago

Looks like the on_attach function sets a CursorHold handler, which gets triggered even after running LspStop.

The consequence is that if an LSP is stopped, neovim will continuously spam the following error:

Error detected while processing CursorHold Autocommands for "<buffer=1>":
method textDocument/documentSymbol is not supported by any of the servers registered for the current buffer

I think there may be two possible fixes:

  1. Remove the CursorHold handler when an LSP detatches. This seems like the correct fix, but I'm not sure how to do it.
  2. Check that an LSP supports textDocument/documentSymbol inside update_current_function. This might be more inefficient but easier to do.