aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-registry/sources/file.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-registry/sources/file.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-registry/sources/file.lua')
-rw-r--r--lua/mason-registry/sources/file.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/lua/mason-registry/sources/file.lua b/lua/mason-registry/sources/file.lua
index d81fcc9c..34c855c0 100644
--- a/lua/mason-registry/sources/file.lua
+++ b/lua/mason-registry/sources/file.lua
@@ -44,7 +44,7 @@ function FileRegistrySource:reload(specs)
self.buffer = _.assoc("specs", specs, self.buffer or {})
self.buffer.instances = _.compose(
_.index_by(_.prop "name"),
- _.map(util.hydrate_package(self.buffer.instances or {}))
+ _.map(util.hydrate_package(self, self.buffer.instances or {}))
)(self:get_all_package_specs())
return self.buffer
end
@@ -182,6 +182,13 @@ function FileRegistrySource:get_display_name()
end
end
+function FileRegistrySource:serialize()
+ return {
+ proto = "file",
+ path = self.id,
+ }
+end
+
function FileRegistrySource:__tostring()
return ("FileRegistrySource(path=%s)"):format(self.spec.path)
end