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 <alex@courtis.org>
This commit is contained in:
Lev Yuvenskiy 2025-01-13 07:15:48 +03:00 committed by GitHub
parent 68fc4c20f5
commit aae01853dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -128,8 +128,7 @@ function M.update_lsp(ev)
local profile_event = log.profile_start("DiagnosticChanged event") local profile_event = log.profile_start("DiagnosticChanged event")
---@type vim.Diagnostic[] local diagnostics = vim.diagnostic.get(ev.buf)
local diagnostics = ev.data.diagnostics
-- use the buffer from the event, as ev.data.diagnostics will be empty on resolved diagnostics -- 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)) local bufname = uniformize_path(vim.api.nvim_buf_get_name(ev.buf))