Set empty diagnostics on code action params

Follow up to 6e99fc8076

The diagnostics are not nullable:

- https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionContext
This commit is contained in:
Mathias Fussenegger 2024-08-05 20:55:42 +02:00 committed by Mathias Fußenegger
parent be5c8d49e0
commit 99e4b2081d

View file

@ -840,11 +840,16 @@ end
local function make_code_action_params(from_selection)
local params
if from_selection then
return vim.lsp.util.make_given_range_params()
params = vim.lsp.util.make_given_range_params()
else
return vim.lsp.util.make_range_params()
params = vim.lsp.util.make_range_params()
end
params.context = {
diagnostics = {}
}
return params
end