From aae01853ddbd790d1efd6ff04ff96cf38c02c95f Mon Sep 17 00:00:00 2001 From: Lev Yuvenskiy Date: Mon, 13 Jan 2025 07:15:48 +0300 Subject: [PATCH] fix(#3041): use vim.diagnostic.get for updating diagnostics (#3042) * fix(#3041): use vim.diagnostic.get for updating diagnostics * fix(#3041): remove unnecessary @type --------- Co-authored-by: Alexander Courtis --- lua/nvim-tree/diagnostics.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/nvim-tree/diagnostics.lua b/lua/nvim-tree/diagnostics.lua index e18b992f1e0..76810d4a796 100644 --- a/lua/nvim-tree/diagnostics.lua +++ b/lua/nvim-tree/diagnostics.lua @@ -128,8 +128,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))