Skip to content

bug: mason registry verification fails #403

@logrusx

Description

@logrusx

Did you check docs and existing issues?

  • I have read all the plugin docs
  • I have searched the existing issues
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.11.2

Operating system/version

Linux

Describe the bug

Invalid mason registry verification fails even when nvim-java registry is configured correctly.

This setup to exit early, preventing nvim-java from setting up correctly.

It happens because the startup check is performed before the registry is added to Mason.

I uncovered this issue while migrating that part to Mason 2.0.. It perhaps have been hiding behind the invalid_mason_registry verification being default disabled in the configuration.

The fix is extracting the registry setup code from java.startup.mason-dep.install into a separate function and calling it in java.setup prior to the startup check. I have a PR coming.

Steps To Reproduce

  1. Enable invalid mason registry verification:
require('java').setup {
    verification = { invalid_mason_registry = true }
}
  1. Start Neovim
  2. The following text error message is printed:
nvim-java mason registry is not added correctly!                                                                                              
This occurs when mason.nvim configured incorrectly                                                                                            
Please refer the link below to fix the issue                                                                                                  
https://github.com/nvim-java/nvim-java/wiki/Q-&-A#no_entry-cannot-find-package-xxxxx 

Expected Behavior

Neovim starts without error messages regarding mason repository verification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions