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

Mason does not install the registry until manually opened #1794

Open
2 tasks done
ferdinandrau opened this issue Sep 21, 2024 · 1 comment
Open
2 tasks done

Mason does not install the registry until manually opened #1794

ferdinandrau opened this issue Sep 21, 2024 · 1 comment

Comments

@ferdinandrau
Copy link

ferdinandrau commented Sep 21, 2024

I've searched open issues for similar requests

  • Yes

I've recently downloaded the latest plugin version of mason.nvim

  • Yes

Problem description

I am trying to use mason in conjunction with mason-lspconfig to auto-install my language servers upon cloning my config to a fresh machine. This does however not happen until i manually open the :Mason window and let it sit for a couple of seconds or run :MasonUpdate, because it's missing the registry (a :checkhealth confirms this).

Expected behavior

Mason should be fully functional after running setup() and be able to grab the data it needs without requiring user interaction. It should install the packages mason-lspconfig has detected automatically.

Steps to reproduce

  1. use this minimal init.lua:
local lazy_path = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"

if not (vim.uv or vim.loop).fs_stat(lazy_path) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"--branch=stable",
		"https://github.com/folke/lazy.nvim.git",
		lazy_path,
	})
end

vim.opt.runtimepath:prepend(lazy_path)

require("lazy").setup({
	{
		"williamboman/mason.nvim",
		config = function()
			require("mason").setup({
				ui = {
					check_outdated_packages_on_open = false,
					border = "single",
					height = 0.8,
				},
			})
		end,
	},
	{
		"williamboman/mason-lspconfig.nvim",
		dependencies = { "mason.nvim" },
		config = function()
			require("mason-lspconfig").setup({ automatic_installation = true })
		end,
	},
	{
		"neovim/nvim-lspconfig",
		dependencies = { "mason-lspconfig.nvim" },
		config = function()
			require("lspconfig").clangd.setup({})
		end,
	},
}, {})

... as you can see, the sequencing of the plugins is correct.

  1. open Neovim and wait, nothing gets installed. Close and reopen as many times as you like, it stays this way.
  2. open :Mason (and wait some time) or run :MasonUpdate
  3. reopen Neovim, the package(s), in this case clangd, will now get installed

Neovim version (>= 0.7)

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1725453128

Operating system/version

Darwin 23.6.0 (macOS)

Healthcheck output

mason.nvim
- OK mason.nvim version v1.10.0
- OK PATH: prepend
- OK Providers: 
    mason.providers.registry-api
    mason.providers.client
- OK neovim version >= 0.7.0

mason.nvim [Registries]
- ERROR Registry `github.com/mason-org/mason-registry [uninstalled]` is not installed.
  - ADVICE:
    - Run :MasonUpdate to install.


(this is before opening Mason)

Screenshots

No response

@thesambayo
Copy link

I'm having the same issue (same neovim version).
I'm unable to connect to the remote registry.

Tried switching from NVIM v0.10.1 to an older version (0.9.5) but I could not do that with brew.
Had to pause my neovim learning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants