feat: rewrite of spec resolving

This commit is contained in:
Folke Lemaitre 2024-06-22 22:18:26 +02:00
parent 8d35e60eeb
commit 75ffe56f70
9 changed files with 558 additions and 429 deletions

View file

@ -59,7 +59,6 @@ function M.check()
else
for _, plugin in pairs(spec.plugins) do
M.check_valid(plugin)
M.check_override(plugin)
end
if #spec.notifs > 0 then
error("Issues were reported when loading your specs:")
@ -88,23 +87,6 @@ function M.check_valid(plugin)
end
end
---@param plugin LazyPlugin
function M.check_override(plugin)
if not plugin._.super then
return
end
local Handler = require("lazy.core.handler")
local skip = { "dependencies", "_", "opts", 1 }
vim.list_extend(skip, vim.tbl_values(Handler.types))
for key, value in pairs(plugin._.super) do
if not vim.tbl_contains(skip, key) and plugin[key] and plugin[key] ~= value then
warn("{" .. plugin.name .. "}: overriding <" .. key .. ">")
end
end
end
M.valid = {
1,
"_",