Changes to the mason.nvim registry #1113
Replies: 8 comments 46 replies
-
Congratulations for the effort and the communication! What does this mean for plugins such as mason-lspconfig, mason-dap...? |
Beta Was this translation helpful? Give feedback.
-
Also, if you're programmatically interfacing with There are two new functions added to the local registry = require("mason-registry")
-- --- snip ---
-- :h mason-registry.refresh()
registry.refresh(function ()
-- This callback is called when the local registry is reasonably up to date.
-- Interacting with the registry, such as getting packages, can be done with
-- reasonable certainty that they can be loaded.
end)
-- You can also refresh the registry synchronously (i.e. blocks execution) if working with callbacks is difficult.
-- Note that this freezes the editor if the registry needs to be updated (otherwise it yields back immediately).
registry.refresh()
-- --- snip ---
-- :h mason-registry.update()
-- To "force" an update of the registry you can use the .update() function instead.
-- This can also be done via the :MasonUpdate command (which prints feedback to vim.notify).
registry.update(function (ok, err)
if ok then
-- registry was successfully updated
else
-- registry failed to update
end
end) You can also pin the registry version when setting up Mason (I don't recommend doing it but there are use cases for it), like so: require("mason").setup {
registries = {
"lua:mason-registry.index", -- over time this registry will be depleted of packages and replaced with the one below
-- Note that the mason-org/mason-registry very frequently releases new versions (usually many times a day).
-- Pinning the version means that users wont receive new packages or version upgrades.
"github:mason-org/mason-registry@2023-03-20-knotty-zipper" -- pinned version
}
} Ping @kylo252 @folke @mehalter @siduck et al. If you have a bootstrap step in your distributions you might want to consider incorporating |
Beta Was this translation helpful? Give feedback.
-
So if I understand correctly, it would be good to add Or is it better to just always execute the Will the refresh callback then always be executed? Even when the registry didn't update? Would mason-lspconfig's Would mason-lspconfig Sorry for all the questions :) Nice update btw!! |
Beta Was this translation helpful? Give feedback.
-
Amazing work so far! A bit late to the party, but I'm a bit uncertain about some a few things
|
Beta Was this translation helpful? Give feedback.
-
would this help more advanced lsp setup scenarios like for fsharp, when fsautocomplete can be used on it's own, but if you want to use Ionide, the actual lsp should be downloaded and installed, but setup and loaded through Ionide? I think Java has something funky like that too right? and rust? Am I understanding correctly that it could have another registration that could be doing this automatically, or is my ignorance showing again? lol. |
Beta Was this translation helpful? Give feedback.
-
Is there a manual fix to get around this error? |
Beta Was this translation helpful? Give feedback.
-
So I'm using AstroNvim configurations. It is using Lazy.nvim to handle packages, I just upgraded to their latest version and I can't seem to get over this error (as commented above). This works on my Ubuntu Linux x86_64 computer, however does not work on my MacOS M1 ARM (although don't think architecture matters here) When I
I added the following to my
This effectively gets rid of the error message, however, it shows no listed packages/modules, everything is zeros. In I'm not 100% sure if this is related but it is very frustrating! |
Beta Was this translation helpful? Give feedback.
-
LazyVim 10 also gives the same error, i am using GITHUB_TOKEN in my environment for authentication so I cannot login with gh cli.
How can I fix this? |
Beta Was this translation helpful? Give feedback.
-
Hello! This is a PSA for people who use mason.nvim (tl;dr at the bottom). Going forward the core registry will be hosted as a collection of static, YAML-based, package definitions at https://github.com/mason-org/mason-registry, as opposed to bundled with the
mason.nvim
plugin itself as Lua modules. This decouples the infrastructure in such a way that the Lua plugin becomes a standalone client that can be hooked into more registries than just the core one, as well as more easily be subject to versioning (mason.nvim currently doesn't version itself due to the fact that packages are bundled with it, which complicates things). This decoupling also lowers the barrier of entry for additional maintainers who can solely focus on the registry, without having to learn the internals of the plugin (more info will come soon if you're interested in possibly helping maintain the core registry).The migration will be entirely seamless, the plan is to simply replace the Lua-based packages in batches.
For those interested, some notable features of the new registry specification are:
.jar
files, which can be accessed viavim.fn.expand("$MASON/share/some-package/the.jar")
instead of reaching into internal package structures (which is unsupported and prone to breakage across versions).With the stability that this new registry brings I will start looking into some old, popular, feature requests such as a locking mechanism and automatic installation.
I also want to explore adding treesitter and plugin support. The latter should be fairly straight forward as the infrastructure is largely in place already, but is something I've deprioritized due to the introduction of the excellent lazy.nvim plugin manager.
I also want to thank current & past GitHub sponsors who help finance costs associated with the plugin. I regularly pay the surplus forward to other devs whose tooling I heavily rely on (huge shout-out to sumneko for working on the Lua language server, without it a plugin of the complexity of
mason.nvim
would be impossible, go sponsor them here).tl;dr: the core mason.nvim registry is moving to https://github.com/mason-org/mason-registry. this will be a fully seamless migration so you shouldn't notice anything.
Beta Was this translation helpful? Give feedback.
All reactions