From 9bff979e1029c542f90787f7ef2d0423faac2c76 Mon Sep 17 00:00:00 2001 From: Lev Yuvenskiy Date: Thu, 2 Jan 2025 15:12:07 +0300 Subject: [PATCH 1/2] fix(#3041): use vim.diagnostic.get for updating diagnostics --- lua/nvim-tree/diagnostics.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-tree/diagnostics.lua b/lua/nvim-tree/diagnostics.lua index e18b992f1e0..5c84a28f5e9 100644 --- a/lua/nvim-tree/diagnostics.lua +++ b/lua/nvim-tree/diagnostics.lua @@ -129,7 +129,7 @@ function M.update_lsp(ev) local profile_event = log.profile_start("DiagnosticChanged event") ---@type vim.Diagnostic[] - local diagnostics = ev.data.diagnostics + local diagnostics = vim.diagnostic.get(ev.buf) -- use the buffer from the event, as ev.data.diagnostics will be empty on resolved diagnostics local bufname = uniformize_path(vim.api.nvim_buf_get_name(ev.buf)) From b9f3f6c033abeb6e0007abe3264c656463084b49 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 13 Jan 2025 15:14:27 +1100 Subject: [PATCH 2/2] fix(#3041): remove unnecessary @type --- lua/nvim-tree/diagnostics.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/nvim-tree/diagnostics.lua b/lua/nvim-tree/diagnostics.lua index 5c84a28f5e9..76810d4a796 100644 --- a/lua/nvim-tree/diagnostics.lua +++ b/lua/nvim-tree/diagnostics.lua @@ -128,7 +128,6 @@ function M.update_lsp(ev) local profile_event = log.profile_start("DiagnosticChanged event") - ---@type vim.Diagnostic[] local diagnostics = vim.diagnostic.get(ev.buf) -- use the buffer from the event, as ev.data.diagnostics will be empty on resolved diagnostics