mirror of
https://github.com/neovim/neovim.git
synced 2026-03-31 04:42:03 +00:00
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 <ziemcd@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user