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

Workspace diagnostics only includes open buffers #26

Closed
disrupted opened this issue May 8, 2021 · 6 comments · Fixed by #244
Closed

Workspace diagnostics only includes open buffers #26

disrupted opened this issue May 8, 2021 · 6 comments · Fixed by #244

Comments

@disrupted
Copy link

disrupted commented May 8, 2021

I can't figure out how to get all workspace diagnostics to show up.

I have lsp_extensions.nvim installed and overridden the publishDiagnostics handler in my config like so:

vim.lsp.handlers['textDocument/publishDiagnostics'] =
    vim.lsp.with(require('lsp_extensions.workspace.diagnostic').handler, {
        underline = false,
        signs = true,
        update_in_insert = false -- delay update
    })

When I run

:lua require('lsp_extensions.workspace.diagnostic').set_qf_list()

the quickfix list contains all diagnostics of files in the workspace. However when I run

:LspTroubleToggle lsp_workspace_diagnostics

it is empty. update: I actually just figured out it only shows diagnostics of currently open buffers.

How can I configure Trouble to pick up all workspace diagnostics?

@disrupted disrupted changed the title Workspace diagnostics empty Only shows workspace diagnostics of open buffers May 8, 2021
@disrupted disrupted changed the title Only shows workspace diagnostics of open buffers Workspace diagnostics only includes open buffers May 8, 2021
@folke
Copy link
Owner

folke commented May 9, 2021

A couple of days ago, I apparently switched up the "document" with "workspace" diagnostics, so lsp_workspace_diagnostics actually showed those for the document only and vice versa.

This should now be fixed. Sorry about that

@disrupted
Copy link
Author

Thanks, it's working now.

@harrysolovay
Copy link

harrysolovay commented Jul 28, 2021

I'm running into this same issue. I also have nvim-lua/lsp_extensions.nvim installed. I'm setting the callback as follows:

vim.lsp.handlers["textDocument/publishDiagnostics"] =
    vim.lsp.with(
    require("lsp_extensions.workspace.diagnostic").handler,
    {
        underline = false,
        signs = true,
    }
)

Calling :LspTroubleToggle lsp_workspace_diagnostics still only shows diagnostics for the current buffer :/

Any advice would be greatly appreciated! Thank you!

@rphuber
Copy link

rphuber commented Jun 25, 2022

can we reopen this? I am getting the same behavior as well. It is only showing diagnostics from files open in buffers and not the workspace. or perhaps I am misunderstanding how workspace works? any help will be appreciated. Thanks!

@disrupted
Copy link
Author

@rphuber which language server? With Pyright, which I use most, workspace diagnostics are working. Perhaps it's simply not supported by your LS.

@artemave
Copy link

artemave commented Jul 7, 2024

This plugin does workspace diagnostics https://github.com/artemave/workspace-diagnostics.nvim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants