File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ local severity_levels = {
15
15
--- @type table
16
16
local buffer_severity_dict = {}
17
17
18
+ --- The cache version number of the buffer-severity mappings.
19
+ --- @type integer
20
+ local BUFFER_SEVERITY_VERSION = 0
21
+
18
22
--- @param path string
19
23
--- @return string
20
24
local function uniformize_path (path )
@@ -91,6 +95,7 @@ function M.update()
91
95
else
92
96
buffer_severity_dict = from_nvim_lsp ()
93
97
end
98
+ BUFFER_SEVERITY_VERSION = BUFFER_SEVERITY_VERSION + 1
94
99
log .node (" diagnostics" , buffer_severity_dict , " update" )
95
100
log .profile_end (profile )
96
101
if view .is_buf_valid (view .get_bufnr ()) then
101
106
102
107
--- @param node Node
103
108
function M .update_node_severity_level (node )
104
- if not M .enable then
109
+ if not M .enable or node . diag_status_version == BUFFER_SEVERITY_VERSION then
105
110
return
106
111
end
107
112
@@ -127,6 +132,7 @@ function M.update_node_severity_level(node)
127
132
else
128
133
node .diag_status = buffer_severity_dict [nodepath ]
129
134
end
135
+ node .diag_status_version = BUFFER_SEVERITY_VERSION
130
136
end
131
137
132
138
function M .setup (opts )
Original file line number Diff line number Diff line change 18
18
--- @field type string
19
19
--- @field watcher function | nil
20
20
--- @field diag_status integer | nil
21
+ --- @field diag_status_version integer | nil
21
22
22
23
--- @class DirNode : BaseNode
23
24
--- @field has_children boolean
You can’t perform that action at this time.
0 commit comments