feat(ui): improvements to profiling and rendering of loaded reasons

This commit is contained in:
Folke Lemaitre 2022-12-01 16:27:52 +01:00
parent 5eb2622a4e
commit 714bc0a136
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
5 changed files with 21 additions and 12 deletions

View file

@ -36,6 +36,7 @@ M.defaults = {
border = "none",
icons = {
start = "",
init = "",
plugin = "",
source = "",
config = "",

View file

@ -28,15 +28,15 @@ function M.setup()
end
function M.init_plugins()
Util.track("plugin_init")
Util.track({ start = "init" })
for _, plugin in pairs(Config.plugins) do
if plugin.init then
Util.track({ plugin = plugin.name, start = "init" })
Util.track({ plugin = plugin.name, init = "init" })
Util.try(plugin.init, "Failed to run `init` for **" .. plugin.name .. "**")
Util.track()
end
if plugin.lazy == false then
M.load(plugin, { start = "start" })
M.load(plugin, { start = "startup" })
end
end
Util.track()

View file

@ -11,7 +11,7 @@ local M = {}
---@field build? string|fun(LazyPlugin)
---@class LazyPluginState
---@field loaded? {[string]:string, time:number}
---@field loaded? {[string]:string}|{time:number}
---@field installed boolean
---@field tasks? LazyTask[]
---@field dirty? boolean