Skip to content

Commit 58143fc

Browse files
committed
fix(#2954): use LSP diagnostic data deltas from events instead of a full query
1 parent 6fe0de6 commit 58143fc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/nvim-tree/diagnostics.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ local function from_cache(node)
117117
return { value = max_severity, cache_version = NODE_SEVERITIES_VERSION }
118118
end
119119

120-
---Fired on DiagnosticChanged for a single buffer
120+
---Fired on DiagnosticChanged for a single buffer.
121+
---This will be called on set and reset of diagnostics.
122+
---On disabling LSP, a reset event will be sent for all buffers.
121123
---@param ev table standard event with data.diagnostics populated
122124
function M.update_lsp(ev)
123125
if not M.enable or not ev or not ev.data or not ev.data.diagnostics then
@@ -171,7 +173,7 @@ function M.update_coc()
171173
return
172174
end
173175
utils.debounce("CocDiagnosticChanged update", M.debounce_delay, function()
174-
local profile = log.profile_start("diagnostics update")
176+
local profile = log.profile_start("CocDiagnosticChanged update")
175177
NODE_SEVERITIES = from_coc()
176178
NODE_SEVERITIES_VERSION = NODE_SEVERITIES_VERSION + 1
177179
if log.enabled("diagnostics") then

0 commit comments

Comments
 (0)