fix(providers): run sync to avoid race (#214)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham 2024-08-25 13:38:40 -04:00 committed by GitHub
parent d9cbcdbfb7
commit 39d54e2674
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -228,6 +228,8 @@ M = setmetatable(M, {
end
end
t[k].setup()
return t[k]
end,
})
@ -236,9 +238,7 @@ M.setup = function()
---@type AvanteProviderFunctor
local provider = M[Config.provider]
E.setup({ provider = provider })
vim.schedule(function()
provider.setup()
end)
M.commands()
end
@ -250,6 +250,7 @@ function M.refresh(provider)
---@type AvanteProviderFunctor
local p = M[Config.provider]
p.setup()
if not p.has() then
E.setup({ provider = p, refresh = true })
else