mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-12-25 12:14:19 +01:00
feat(extras): automatically update lazyvim.json for renamed or deprecated extras
This commit is contained in:
@@ -25,12 +25,29 @@ end
|
||||
local extras = {} ---@type string[]
|
||||
local defaults = LazyVim.config.get_defaults()
|
||||
|
||||
local changed = false
|
||||
local updated = {} ---@type string[]
|
||||
|
||||
-- Add extras from LazyExtras that are not disabled
|
||||
for _, extra in ipairs(LazyVim.config.json.data.extras) do
|
||||
local def = defaults[extra]
|
||||
if not (def and def.enabled == false) then
|
||||
extras[#extras + 1] = extra
|
||||
if LazyVim.plugin.renamed_extras[extra] then
|
||||
extra = LazyVim.plugin.renamed_extras[extra]
|
||||
changed = true
|
||||
end
|
||||
if LazyVim.plugin.deprecated_extras[extra] then
|
||||
changed = true
|
||||
else
|
||||
updated[#updated + 1] = extra
|
||||
local def = defaults[extra]
|
||||
if not (def and def.enabled == false) then
|
||||
extras[#extras + 1] = extra
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if changed then
|
||||
LazyVim.config.json.data.extras = updated
|
||||
LazyVim.json.save()
|
||||
end
|
||||
|
||||
-- Add default extras
|
||||
|
||||
Reference in New Issue
Block a user