diff --git a/lua/codecompanion/config.lua b/lua/codecompanion/config.lua index e2c62276..a67cbe1d 100644 --- a/lua/codecompanion/config.lua +++ b/lua/codecompanion/config.lua @@ -64,7 +64,7 @@ local defaults = { M.setup = function(opts) M.options = vim.tbl_deep_extend("force", {}, defaults, opts or {}) - -- Handle adapter updates + -- Handle custom adapter config if opts and opts.adapters then for name, adapter in pairs(opts.adapters) do if M.options.adapters[name] then @@ -79,6 +79,12 @@ M.setup = function(opts) end end end + else + for _, adapter in pairs(M.options.strategies) do + if type(M.options.adapters[adapter]) == "string" then + M.options.adapters[adapter] = require("codecompanion.adapters").use(adapter) + end + end end M.INFO_NS = vim.api.nvim_create_namespace("CodeCompanion-info")