mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(picker.lsp): move get_clients inside vim.schedule to prevent issues on Neovim 0.11. Closes #2320
This commit is contained in:
parent
889515a336
commit
79f3a8d8b3
1 changed files with 4 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue