My LSP config works perfectly for the current buffer, but sometimes I just want to check the whole project and find all problems. I know that folke/trouble.nvim could show workspace diagnostics, but how to collect it in one command? My projects are using typescript
2 Answers
Expounding on @artemave's answer, the workspace-diagnostics.nvim plugin sends the textDocument/didOpen
events from neovim's LSP client to the language server for all files in the workspace. It does so by simply looping over each file in the workspace (via git ls-files
, which doesn't seem like the most robust solution) and sending the command to the server. It is activated inside the on_attach
callback inside the lspconfig
setup()
function for the corresponding language.
It is fully explained in the author's post.
This plugin should do the trick https://github.com/artemave/workspace-diagnostics.nvim
-
3A little bit of an explanation how it does the trick would greatly improve your answer. Commented Jul 7 at 17:38
-
2Answers containing only links do not answer the question: vi.stackexchange.com/help/how-to-answer– D. Ben Knoble ♦Commented Jul 7 at 20:40