Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#3041): use vim.diagnostic.get for updating diagnostics #3042

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

Yu-Leo
Copy link
Contributor

@Yu-Leo Yu-Leo commented Jan 2, 2025

Fixes #3041

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for deep diving.

I did wonder why there were two instances of Diagnostics[] however this looks far more reliable.

In the interests of speed I'll remove the now unnecessary @type

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks safe for 0.10

@alex-courtis alex-courtis merged commit aae0185 into nvim-tree:master Jan 13, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants