* fix(#2519): diagnostics overhaul
Signed-off-by: iusmac <iusico.maxim@libero.it>
* fix: Properly filter diagnostics from coc
Also, while we're at it, refactor the lsp function for consistency.
There should be no functional change, just cosmetic.
Signed-off-by: iusmac <iusico.maxim@libero.it>
* Assign diagnostic version per node to reduce overhead
Signed-off-by: iusmac <iusico.maxim@libero.it>
* Require renderer once
Signed-off-by: iusmac <iusico.maxim@libero.it>
* Revert "Require renderer once"
Causes circular requires after the previous commit.
This reverts commit 7413041630.
* Rename `buffer_severity_dict` to `BUFFER_SEVERITY`
Signed-off-by: iusmac <iusico.maxim@libero.it>
* Log diagnostics update properly
Signed-off-by: iusmac <iusico.maxim@libero.it>
* Implement error handling for coc.nvim
Signed-off-by: iusmac <iusico.maxim@libero.it>
* CI style fixes
Signed-off-by: iusmac <iusico.maxim@libero.it>
* Capture `Keyboard interrupt` when handling coc exceptions
Signed-off-by: iusmac <iusico.maxim@libero.it>
* add more doc
---------
Signed-off-by: iusmac <iusico.maxim@libero.it>
Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local HL_POSITION = require("nvim-tree.enum").HL_POSITION
|
||||
local diagnostics = require "nvim-tree.diagnostics"
|
||||
|
||||
local M = {
|
||||
HS_FILE = {},
|
||||
@@ -17,10 +18,11 @@ function M.get_highlight(node)
|
||||
end
|
||||
|
||||
local group
|
||||
local diag_status = diagnostics.get_diag_status(node)
|
||||
if node.nodes then
|
||||
group = M.HS_FOLDER[node.diag_status]
|
||||
group = M.HS_FOLDER[diag_status and diag_status.value]
|
||||
else
|
||||
group = M.HS_FILE[node.diag_status]
|
||||
group = M.HS_FILE[diag_status and diag_status.value]
|
||||
end
|
||||
|
||||
if group then
|
||||
@@ -35,7 +37,8 @@ end
|
||||
---@return HighlightedString|nil modified icon
|
||||
function M.get_icon(node)
|
||||
if node and M.config.diagnostics.enable and M.config.renderer.icons.show.diagnostics then
|
||||
return M.ICON[node.diag_status]
|
||||
local diag_status = diagnostics.get_diag_status(node)
|
||||
return M.ICON[diag_status and diag_status.value]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user