trouble.nvim icon indicating copy to clipboard operation
trouble.nvim copied to clipboard

Fix: Invalid Severity Mapping in Quickfix/Loclist Providers

Open scienceplease opened this issue 2 years ago • 0 comments

Neovim's diagnostic severity HINT should map to Vim/quickfix note, which is represented by N [1] [2]. Trouble currently maps HINT to nonexistent H. This results in diagnostic hints in quickfix/loclist being displayed as "other" in Trouble. To produce this bug, add diagnostics to your loclist or quickfix lists using vim.diagnostic.setloclist() or vim.diagnostic.setqflist() and view either with :Trouble loclist or :Trouble quickfix respectively. I confirmed the fix below resolves this issue.

Current: https://github.com/folke/trouble.nvim/blob/691d490cc4eadc430d226fa7d77aaa84e2e0a125/lua/trouble/providers/qf.lua#L5

Fix:

local severities = { E = 1, W = 2, I = 3, N = 4 }

scienceplease avatar May 04 '22 18:05 scienceplease