Assigning M.vendors to an empty table {} at line 267 causes the metatable set for M at line 340 to lose its effect. As a result, accessing M.vendors does not retrieve the correct vendors from the configuration but instead always accesses an empty table.
This commit is contained in:
parent
d135cfa270
commit
1660ca5c51
@ -263,9 +263,6 @@ M.diff = {}
|
||||
---@type Provider[]
|
||||
M.providers = {}
|
||||
|
||||
---@type AvanteProvider[]
|
||||
M.vendors = {}
|
||||
|
||||
---@param opts? avante.Config
|
||||
function M.setup(opts)
|
||||
vim.validate({ opts = { opts, "table", true } })
|
||||
@ -357,7 +354,7 @@ M.has_provider = function(provider) return M._options[provider] ~= nil or M.vend
|
||||
M.get_provider = function(provider)
|
||||
if M._options[provider] ~= nil then
|
||||
return vim.deepcopy(M._options[provider], true)
|
||||
elseif M.vendors[provider] ~= nil then
|
||||
elseif M.vendors and M.vendors[provider] ~= nil then
|
||||
return vim.deepcopy(M.vendors[provider], true)
|
||||
else
|
||||
error("Failed to find provider: " .. provider, 2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user