fix(picker.lsp): move get_clients inside vim.schedule to prevent issues on Neovim 0.11. Closes #2320

This commit is contained in:
Folke Lemaitre 2025-10-22 21:54:05 +02:00
parent 889515a336
commit 79f3a8d8b3
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -132,14 +132,11 @@ end
---@param cb fun(client:vim.lsp.Client, result:table, params:table)
---@async
function R:request(buf, method, params, cb)
local clients = type(buf) == "number" and M.get_clients(buf, method) or {
wrap(buf --[[@as vim.lsp.Client]]),
}
if vim.tbl_isempty(clients) then
return self.async:resume()
end
vim.schedule(function()
local clients = type(buf) == "number" and M.get_clients(buf, method)
or {
wrap(buf --[[@as vim.lsp.Client]]),
}
for _, client in ipairs(clients) do
local p = params(client)
local status, request_id = client:request(method, p, function(_, result)