From 6a49a277f517bd5fd51c62a3dcda5d00d91a8401 Mon Sep 17 00:00:00 2001 From: tris203 Date: Sun, 15 Mar 2026 21:51:47 +0000 Subject: [PATCH] fix(lsp): request diagnostics from all registrations Update diagnostic refresh to request diagnostics from all provider registrations using _provider_foreach. This ensures diagnostics are fetched from every registered provider during a refresh. Co-authored-by: ZieMcd --- runtime/lua/vim/lsp/diagnostic.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index 7a84cc9f80..2d224722ea 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -381,12 +381,16 @@ function M._refresh(bufnr, client_id, only_visible) type = 'pending', }) for _, client in ipairs(clients) do - ---@type lsp.DocumentDiagnosticParams - local params = { - textDocument = util.make_text_document_params(bufnr), - previousResultId = bufstate.client_result_id[client.id], - } - client:request(method, params, nil, bufnr) + ---@param cap lsp.DiagnosticRegistrationOptions + client:_provider_foreach(method, function(cap) + ---@type lsp.DocumentDiagnosticParams + local params = { + identifier = cap.identifier, + textDocument = util.make_text_document_params(bufnr), + previousResultId = bufstate.client_result_id[client.id], + } + client:request(method, params, nil, bufnr) + end) end end