RaafatTurki / corn.nvim

LSP diagnostics at your corner
104 stars 7 forks source link

Disable specific diagnostics? #9

Closed JustBarnt closed 5 months ago

JustBarnt commented 5 months ago

I currently over write the diagnostics that get show with the LSP, but for what ever reason Corn doesn't seem to be respecting that, and I still see Hint type diagnostics. How can I disable that?

-- Override LSP diagnostics support if its supported.
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
    vim.lsp.diagnostic.on_publish_diagnostics, {
        signs = { severity_limit = "Warning" },
        underline = { severity_limit = "Warning" },
        virtual_text = false,
    }
)
RaafatTurki commented 5 months ago

Hi, Corn uses the vim.diagnostic.get API to fetch LSP diags and that doesn't respect severity limiting the way you've shown above.

Regardless, in the spirit of customization the new update 77f0a812a0307ab8ecf0ed4e0b5a8864fb56a0ab introduces the config option blacklisted_severities which allows the user to pick-and-choose which severities to disable rather than setting a linear limit.