refactor: Plugin.requires => Plugin.dependencies

This commit is contained in:
Folke Lemaitre 2022-11-29 14:27:04 +01:00
parent 0f5ceb9012
commit 7328e290ba
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
2 changed files with 5 additions and 5 deletions

View File

@ -61,8 +61,8 @@ function M.load(plugins, reason, opts)
Util.track({ plugin = plugin.name, start = reason.start })
M.packadd(plugin, opts and opts.load_start)
if plugin.requires then
M.load(plugin.requires, {})
if plugin.dependencies then
M.load(plugin.dependencies, {})
end
if plugin.config then

View File

@ -40,10 +40,10 @@ M.dirty = false
---@field dir string
---@field enabled? boolean|(fun():boolean)
---@field opt? boolean
---@field requires? string[]
---@field dependencies? string[]
---@field _ LazyPluginState
---@alias LazySpec string|LazyPlugin|LazySpec[]|{requires:LazySpec}
---@alias LazySpec string|LazyPlugin|LazySpec[]|{dependencies:LazySpec}
---@class LazySpecLoader
---@field modname string
@ -103,7 +103,7 @@ function Spec:normalize(spec, results)
elseif spec.enabled == nil or spec.enabled == true or (type(spec.enabled) == "function" and spec.enabled()) then
---@cast spec LazyPlugin
local plugin = self:add(spec)
plugin.requires = plugin.requires and self:normalize(plugin.requires, {}) or nil
plugin.dependencies = plugin.dependencies and self:normalize(plugin.dependencies, {}) or nil
table.insert(results, plugin.name)
end
return results