From 37ecd06fad65d5c188ad2d2e55d47a8fd1594d16 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 Oct 2025 08:46:45 +0200 Subject: [PATCH] feat(extras): automatically update lazyvim.json for renamed or deprecated extras --- lua/lazyvim/plugins/xtras.lua | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index 5db08ef1..8f65f00a 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -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