From 8eb8de29af6e2ab9dd7986e2521178875dbcad95 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 4 Oct 2023 00:20:08 +0200 Subject: [PATCH] feat(plugin): keep track of the module a spec fragment was defined in --- lua/lazy/core/plugin.lua | 1 + lua/lazy/types.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index d0a2f0b..4255366 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -137,6 +137,7 @@ function Spec:add(plugin, results) fid = M.last_fid, fpid = fpid, dep = fpid ~= nil, + module = self.importing, } self.fragments[plugin._.fid] = plugin diff --git a/lua/lazy/types.lua b/lua/lazy/types.lua index 0fa9202..e9c5fbb 100644 --- a/lua/lazy/types.lua +++ b/lua/lazy/types.lua @@ -17,6 +17,7 @@ ---@field dep? boolean True if this plugin is only in the spec as a dependency ---@field cond? boolean ---@field super? LazyPlugin +---@field module? string ---@alias PluginOpts table|fun(self:LazyPlugin, opts:table):table?