aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2026-01-07 16:25:00 +0100
committerGitHub <noreply@github.com>2026-01-07 16:25:00 +0100
commit3fce8bd25e773bae4267c9e8f2cfbfda22aeb017 (patch)
tree9f1e34b7a31cd0b849c7b911254e8866412a6f0d /lua
parentchore(main): release 2.2.0 (#2032) (diff)
downloadmason-3fce8bd25e773bae4267c9e8f2cfbfda22aeb017.tar
mason-3fce8bd25e773bae4267c9e8f2cfbfda22aeb017.tar.gz
mason-3fce8bd25e773bae4267c9e8f2cfbfda22aeb017.tar.bz2
mason-3fce8bd25e773bae4267c9e8f2cfbfda22aeb017.tar.lz
mason-3fce8bd25e773bae4267c9e8f2cfbfda22aeb017.tar.xz
mason-3fce8bd25e773bae4267c9e8f2cfbfda22aeb017.tar.zst
mason-3fce8bd25e773bae4267c9e8f2cfbfda22aeb017.zip
fix(registry): exclude synthesized registry when updating/installing registries (#2054)
This doesn't necessarily fix a "bug" but primarily fixes the message provided to users when updating registries. If a user has 1 registry configured the message is now "updating 2 registries", this fixes it to "updating registry".
Diffstat (limited to 'lua')
-rw-r--r--lua/mason-registry/installer.lua2
-rw-r--r--lua/mason-registry/sources/init.lua6
-rw-r--r--lua/mason-registry/sources/synthesized.lua2
3 files changed, 6 insertions, 4 deletions
diff --git a/lua/mason-registry/installer.lua b/lua/mason-registry/installer.lua
index a5c9fe92..05592227 100644
--- a/lua/mason-registry/installer.lua
+++ b/lua/mason-registry/installer.lua
@@ -40,7 +40,7 @@ function M.install(sources, on_progress)
M.channel = OneShotChannel:new()
local finished_registries = {}
- local registries = sources:to_list { include_uninstalled = true }
+ local registries = sources:to_list { include_uninstalled = true, include_synthesized = false }
local results = {
a.wait_all(_.map(
diff --git a/lua/mason-registry/sources/init.lua b/lua/mason-registry/sources/init.lua
index f468a8ef..36e62ec5 100644
--- a/lua/mason-registry/sources/init.lua
+++ b/lua/mason-registry/sources/init.lua
@@ -191,7 +191,9 @@ function LazySourceCollection:checksum()
return vim.fn.sha256(table.concat(registry_ids, ""))
end
----@param opts? { include_uninstalled?: boolean, include_synthesized?: boolean }
+---@alias LazySourceCollectionIterate { include_uninstalled?: boolean, include_synthesized?: boolean }
+
+---@param opts? LazySourceCollectionIterate
function LazySourceCollection:iterate(opts)
opts = opts or {}
@@ -213,7 +215,7 @@ function LazySourceCollection:iterate(opts)
end
end
----@param opts? { include_uninstalled?: boolean }
+---@param opts? LazySourceCollectionIterate
function LazySourceCollection:to_list(opts)
opts = opts or {}
local list = {}
diff --git a/lua/mason-registry/sources/synthesized.lua b/lua/mason-registry/sources/synthesized.lua
index 75638cd6..8cad635e 100644
--- a/lua/mason-registry/sources/synthesized.lua
+++ b/lua/mason-registry/sources/synthesized.lua
@@ -49,7 +49,7 @@ function SynthesizedRegistrySource:load_package(pkg_name, receipt)
homepage = "",
licenses = {},
deprecation = {
- since = receipt:get_installed_package_version() or "N/A",
+ since = installed_version or "N/A",
message = "This package has been removed from the registry.",
},
source = source,