Files: lua/model_cmp/modelapi/common.lua:44-57
Feature Introduction: Currently adding a new AI backend requires modifying common.lua's if-else chain. A registry pattern lets any backend register itself with a single call.
Feature Description:
-- lua/model_cmp/modelapi/init.lua
function M.register(name, provider)
providers[name] = provider
end
-- lua/model_cmp/modelapi/codestral.lua
require("model_cmp.modelapi").register("codestral", {
generate_request = function(prompt) ... end,
})
Benefits:
- New backends are single-file additions
- User can configure which backends to load
- Clean separation of concerns
Is your feature possible with the current status of repo? Yes. Pure refactor — no behavior changes needed.
Files:
lua/model_cmp/modelapi/common.lua:44-57Feature Introduction: Currently adding a new AI backend requires modifying
common.lua's if-else chain. A registry pattern lets any backend register itself with a single call.Feature Description:
Benefits:
Is your feature possible with the current status of repo? Yes. Pure refactor — no behavior changes needed.