@@ -11,9 +11,9 @@ local severity_levels = {
11
11
Hint = 4 ,
12
12
}
13
13
14
- --- A dictionary tree containing buffer-severity mappings.
14
+ --- The buffer-severity mappings derived during the last diagnostic list update .
15
15
--- @type table
16
- local buffer_severity_dict = {}
16
+ local BUFFER_SEVERITY = {}
17
17
18
18
--- The cache version number of the buffer-severity mappings.
19
19
--- @type integer
@@ -91,12 +91,12 @@ function M.update()
91
91
utils .debounce (" diagnostics" , M .debounce_delay , function ()
92
92
local profile = log .profile_start " diagnostics update"
93
93
if is_using_coc () then
94
- buffer_severity_dict = from_coc ()
94
+ BUFFER_SEVERITY = from_coc ()
95
95
else
96
- buffer_severity_dict = from_nvim_lsp ()
96
+ BUFFER_SEVERITY = from_nvim_lsp ()
97
97
end
98
98
BUFFER_SEVERITY_VERSION = BUFFER_SEVERITY_VERSION + 1
99
- log .node (" diagnostics" , buffer_severity_dict , " update" )
99
+ log .node (" diagnostics" , BUFFER_SEVERITY , " update" )
100
100
log .profile_end (profile )
101
101
if view .is_buf_valid (view .get_bufnr ()) then
102
102
require (" nvim-tree.renderer" ).draw ()
@@ -116,7 +116,7 @@ function M.update_node_severity_level(node)
116
116
if is_folder then
117
117
local max_severity = nil
118
118
if M .show_on_dirs and (not node .open or M .show_on_open_dirs ) then
119
- for bufname , severity in pairs (buffer_severity_dict ) do
119
+ for bufname , severity in pairs (BUFFER_SEVERITY ) do
120
120
local node_contains_buf = vim .startswith (bufname , nodepath .. " /" )
121
121
if node_contains_buf then
122
122
if severity == M .severity .max then
@@ -130,7 +130,7 @@ function M.update_node_severity_level(node)
130
130
end
131
131
node .diag_status = max_severity
132
132
else
133
- node .diag_status = buffer_severity_dict [nodepath ]
133
+ node .diag_status = BUFFER_SEVERITY [nodepath ]
134
134
end
135
135
node .diag_status_version = BUFFER_SEVERITY_VERSION
136
136
end
0 commit comments