feat(extras): big rework of default extras

This commit is contained in:
Folke Lemaitre 2025-02-08 15:04:46 +01:00
parent 0416376733
commit 525377dee9
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
13 changed files with 222 additions and 200 deletions

View file

@ -79,7 +79,16 @@ function M.lazy_file()
end
function M.fix_imports()
local defaults ---@type table<string, LazyVimDefault>
Plugin.Spec.import = LazyVim.inject.args(Plugin.Spec.import, function(_, spec)
if LazyVim.config.json_loaded then
-- extra disabled by defaults?
defaults = defaults or LazyVim.config.get_defaults()
local def = defaults[spec.import]
if def and def.enabled == false then
return false
end
end
local dep = M.deprecated_extras[spec and spec.import]
if dep then
dep = dep .. "\n" .. "Please remove the extra from `lazyvim.json` to hide this warning."