Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programatical way to register custom mason registry #1749

Open
1 task done
s1n7ax opened this issue Jul 3, 2024 · 0 comments
Open
1 task done

Programatical way to register custom mason registry #1749

s1n7ax opened this issue Jul 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@s1n7ax
Copy link
Contributor

s1n7ax commented Jul 3, 2024

I've searched open issues for similar requests

  • Yes

Is your feature request related to a problem? Please describe.

I'm working on nvim-java plugin and following is the way I have added the nvim-java/mason-registry.

https://github.com/nvim-java/nvim-java/blob/26b3d3f38412b8548af40138c8d6ad7787b7ee81/lazy.lua#L14-L19

This obviously only works if opts passed from the plugin actually passed into the mason setup function. It seems a lot of people still doing config = function(_, opts) mason.setup({}) end ignoring the opts passed into the config function. So, packages only available via my repository failed to install.

Most confusing one is jdtls because in the main repository there is jdtls, it fails due to invalid url (because they are using the release date in the jdtls download link).

I'm just wondering if there is a way to add the registry programmatically for local mason instance just to install packages required to run nvim-jdtls.

This is how we are installing pkgs using the global mason instance.
https://github.com/atm1020/nvim-java/blob/26b3d3f38412b8548af40138c8d6ad7787b7ee81/lua/java/utils/mason.lua?plain=1#L65-L78

Describe the solution you'd like

Something like,

local new_reg = mason_registry:new()
new_reg:add('nvim-java/mason-registry')
new_reg:install('jdtls')

Describe potential alternatives you've considered

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Needs triage
Development

No branches or pull requests

1 participant