mirror of
https://github.com/neovim/neovim.git
synced 2025-11-21 09:36:29 +00:00
fix(lsp): store result id for unchanged diagnostic reports
**Problem:** For unchanged document diagnostic reports, the `resultId` is ignored completely, even though it should still be saved for the request (in fact, the spec marks it as mandatory for unchanged reports, so it should be extra important). **Solution:** Always store the `resultId`.
This commit is contained in:
@@ -269,16 +269,20 @@ function M.on_diagnostic(error, result, ctx)
|
||||
return
|
||||
end
|
||||
|
||||
if result == nil or result.kind == 'unchanged' then
|
||||
if result == nil then
|
||||
return
|
||||
end
|
||||
|
||||
local client_id = ctx.client_id
|
||||
handle_diagnostics(ctx.params.textDocument.uri, client_id, result.items, true)
|
||||
|
||||
local bufnr = assert(ctx.bufnr)
|
||||
local bufstate = bufstates[bufnr]
|
||||
bufstate.client_result_id[client_id] = result.resultId
|
||||
|
||||
if result.kind == 'unchanged' then
|
||||
return
|
||||
end
|
||||
|
||||
handle_diagnostics(ctx.params.textDocument.uri, client_id, result.items, true)
|
||||
end
|
||||
|
||||
--- Clear push diagnostics and diagnostic cache.
|
||||
|
||||
Reference in New Issue
Block a user