mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
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:
committed by
GitHub
parent
b2bad0ac91
commit
5c33815448
@@ -116,7 +116,7 @@ local function tokens_to_ranges(data, bufnr, client, request)
|
||||
|
||||
if elapsed_ns > yield_interval_ns then
|
||||
vim.schedule(function()
|
||||
coroutine.resume(co, util.buf_versions[bufnr])
|
||||
coroutine.resume(co, vim.b[bufnr].changedtick)
|
||||
end)
|
||||
if request.version ~= coroutine.yield() then
|
||||
-- request became stale since the last time the coroutine ran.
|
||||
@@ -275,7 +275,7 @@ end
|
||||
---
|
||||
---@package
|
||||
function STHighlighter:send_request()
|
||||
local version = util.buf_versions[self.bufnr]
|
||||
local version = vim.b[self.bufnr].changedtick
|
||||
|
||||
self:reset_timer()
|
||||
|
||||
@@ -418,7 +418,7 @@ end
|
||||
function STHighlighter:on_win(topline, botline)
|
||||
for client_id, state in pairs(self.client_state) do
|
||||
local current_result = state.current_result
|
||||
if current_result.version and current_result.version == util.buf_versions[self.bufnr] then
|
||||
if current_result.version and current_result.version == vim.b[self.bufnr].changedtick then
|
||||
if not current_result.namespace_cleared then
|
||||
api.nvim_buf_clear_namespace(self.bufnr, state.namespace, 0, -1)
|
||||
current_result.namespace_cleared = true
|
||||
|
||||
Reference in New Issue
Block a user