feat(loader): incrementally install missing plugins and rebuild spec, so imported specs from plugins work as expected

This commit is contained in:
Folke Lemaitre 2023-01-02 10:08:45 +01:00
parent 919b7f5de3
commit 2d06faa941
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 43 additions and 17 deletions

View file

@ -80,18 +80,23 @@ function Spec:add(plugin, is_dep)
end
function Spec:error(msg)
self:notify(msg, vim.log.levels.ERROR)
self:log(msg, vim.log.levels.ERROR)
end
function Spec:warn(msg)
self:notify(msg, vim.log.levels.WARN)
self:log(msg, vim.log.levels.WARN)
end
---@param msg string
---@param level number
function Spec:notify(msg, level)
function Spec:log(msg, level)
self.notifs[#self.notifs + 1] = { msg = msg, level = level, file = self.importing }
Util.notify(msg, level)
end
function Spec:report()
for _, notif in ipairs(self.notifs) do
Util.notify(notif.msg, notif.level)
end
end
---@param spec LazySpec|LazySpecImport