refactor(lsp): replace util.buf_versions with changedtick (#28943)

`lsp.util.buf_versions` was already derived from changedtick (`on_lines`
from `buf_attach` synced the version)

As far as I can tell there is no need to keep track of the state in a
separate table.
This commit is contained in:
Mathias Fußenegger
2024-05-30 10:46:26 +02:00
committed by GitHub
parent b2bad0ac91
commit 5c33815448
10 changed files with 52 additions and 57 deletions

View File

@@ -43,7 +43,7 @@ function M.on_inlayhint(err, result, ctx, _)
return
end
local bufnr = assert(ctx.bufnr)
if util.buf_versions[bufnr] ~= ctx.version then
if vim.b[bufnr].changedtick ~= ctx.version then
return
end
local client_id = ctx.client_id
@@ -324,7 +324,7 @@ api.nvim_set_decoration_provider(namespace, {
return
end
if bufstate.version ~= util.buf_versions[bufnr] then
if bufstate.version ~= vim.b[bufnr].changedtick then
return
end