fix(diagnostics)!: restore is_pull namespace argument #38698

Problem:
The current LSP diagnostic implementation can't differ between a pull
diagnostic with no identifier and a set of diagnostics provided via push
diagnostics.

"Anonymous pull providers" are expected by the protocol https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticOptions
, depending on how the capability was registered:
- Dynamic registrations have an identifier.
- Static registrations will not.

Solution:
Restore the `is_pull` argument removed in
https://github.com/neovim/neovim/pull/37938, keeping the identifier of
pull diagnostic collections.

(cherry picked from commit 665ebce569)
This commit is contained in:
Maria Solano
2026-04-08 13:11:01 -07:00
committed by github-actions[bot]
parent 5ac95da8ea
commit c76bbd0a54
4 changed files with 26 additions and 25 deletions

View File

@@ -1369,7 +1369,7 @@ function M.code_action(opts)
local lnum = api.nvim_win_get_cursor(0)[1] - 1
client:_provider_foreach('textDocument/diagnostic', function(cap)
local ns_pull = lsp.diagnostic.get_namespace(client.id, cap.identifier)
local ns_pull = lsp.diagnostic.get_namespace(client.id, true, cap.identifier)
vim.list_extend(
diagnostics,
vim.diagnostic.get(bufnr, { namespace = ns_pull, lnum = lnum })