folke / trouble.nvim

🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
Apache License 2.0
5.36k stars 175 forks source link

filter diagnostics by severity level #285

Closed eatgrass closed 1 year ago

eatgrass commented 1 year ago

feat: filter diagnostics by severity level, with default keybind s

eatgrass commented 1 year ago

I noticed we've got couples of issues and pull requests for the diagnostics filter feature, I implemented this to meet my own requirment, and also tried to keep the simplicity as much as possible.

folke commented 1 year ago

Thank you for this PR. Can you change it so users need to set it using the correct enums instead of a string?

So trouble.opts.severity = vim.diagnostic.severity.ERROR for example.

This will further simplify the code and is more in line on how severities are used in Neovim

eatgrass commented 1 year ago

I changed a little bit, make the severity lsp.DiagnosticSeverity, let me know if it is ok

folke commented 1 year ago

thanks!