Revert "feat(lsp): support version in textDocument/publishDiagnostics #36754" (#36865)

This reverts commit 03d6cf7aae.

See https://github.com/neovim/neovim/pull/36754#issuecomment-3626115697
The change was supposed to avoid showing stale diagnostics but had the
opposite effect.
This commit is contained in:
Mathias Fußenegger
2025-12-09 13:29:21 +01:00
committed by GitHub
parent 23f4fab0bd
commit c5d4050586
4 changed files with 2 additions and 44 deletions

View File

@@ -222,8 +222,7 @@ end
--- @param client_id? integer
--- @param diagnostics lsp.Diagnostic[]
--- @param is_pull boolean
--- @param version integer?
local function handle_diagnostics(uri, client_id, diagnostics, is_pull, version)
local function handle_diagnostics(uri, client_id, diagnostics, is_pull)
local fname = vim.uri_to_fname(uri)
if #diagnostics == 0 and vim.fn.bufexists(fname) == 0 then
@@ -235,10 +234,6 @@ local function handle_diagnostics(uri, client_id, diagnostics, is_pull, version)
return
end
if version and util.buf_versions[bufnr] ~= version then
return
end
client_id = client_id or DEFAULT_CLIENT_ID
local namespace = M.get_namespace(client_id, is_pull)
@@ -254,7 +249,7 @@ end
---@param params lsp.PublishDiagnosticsParams
---@param ctx lsp.HandlerContext
function M.on_publish_diagnostics(_, params, ctx)
handle_diagnostics(params.uri, ctx.client_id, params.diagnostics, false, params.version)
handle_diagnostics(params.uri, ctx.client_id, params.diagnostics, false)
end
--- |lsp-handler| for the method "textDocument/diagnostic"

View File

@@ -559,7 +559,6 @@ function protocol.make_client_capabilities()
valueSet = get_value_set(constants.DiagnosticTag),
},
dataSupport = true,
versionSupport = true,
},
callHierarchy = {
dynamicRegistration = false,