aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/package/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2025-05-06 02:57:26 +0200
committerWilliam Boman <william@redwill.se>2025-05-06 02:57:26 +0200
commitf74983e782b7394f5737df99f8823e196a23291d (patch)
tree15ee15a22ad4e8dff13c050a361c99f08d831212 /lua/mason-core/package/init.lua
parentrefactor(registry): change lua registries to not instantiate Package themselves (diff)
downloadmason-f74983e782b7394f5737df99f8823e196a23291d.tar
mason-f74983e782b7394f5737df99f8823e196a23291d.tar.gz
mason-f74983e782b7394f5737df99f8823e196a23291d.tar.bz2
mason-f74983e782b7394f5737df99f8823e196a23291d.tar.lz
mason-f74983e782b7394f5737df99f8823e196a23291d.tar.xz
mason-f74983e782b7394f5737df99f8823e196a23291d.tar.zst
mason-f74983e782b7394f5737df99f8823e196a23291d.zip
feat: associate package instances with registry source and record it in receipt
Diffstat (limited to 'lua/mason-core/package/init.lua')
-rw-r--r--lua/mason-core/package/init.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/mason-core/package/init.lua b/lua/mason-core/package/init.lua
index 11171aaf..c4ec520f 100644
--- a/lua/mason-core/package/init.lua
+++ b/lua/mason-core/package/init.lua
@@ -105,10 +105,11 @@ local function validate_spec(spec)
end
---@param spec RegistryPackageSpec
-function Package:new(spec)
+---@param reg RegistrySource
+function Package:new(spec, reg)
validate_spec(spec)
---@type Package
- local instance = AbstractPackage.new(self, spec)
+ local instance = AbstractPackage.new(self, spec, reg)
instance.local_semaphore = Semaphore:new(1)
return instance
end