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

@@ -1,6 +1,5 @@
local protocol = require('vim.lsp.protocol')
local sync = require('vim.lsp.sync')
local util = require('vim.lsp.util')
local api = vim.api
local uv = vim.uv
@@ -277,7 +276,7 @@ local function send_changes(bufnr, sync_kind, state, buf_state)
client.notify(protocol.Methods.textDocument_didChange, {
textDocument = {
uri = uri,
version = util.buf_versions[bufnr],
version = vim.b[bufnr].changedtick,
},
contentChanges = changes,
})