Skip to content

Conversation

@veonim
Copy link

@veonim veonim commented Jan 28, 2026

I just did a fresh install today and was thrown into an error that lua_ls not found.

Switched to lua-language-server, making this PR for base repository because other people might face this issue.

@veonim veonim changed the title lua_ls no longer exists in mason registry fix: lua_ls no longer exists in mason registry Jan 28, 2026
@vimjeremy
Copy link

vimjeremy commented Jan 28, 2026

This can be fixed by adding { "mason-org/mason-lspconfig.nvim", opts = {} } to mason's dependencies

Personally, I think this is the cleaner way because it bridges the gap between lspconfig and mason and allows the installation and auto-enabling of lsp servers by the actual configuration name so maintaining the project will be easier over time.

@veonim
Copy link
Author

veonim commented Jan 28, 2026

@vimjeremy Yeah, it did handled that perfectly. Thanks for suggestion, updated the PR

-- Mason must be loaded before its dependents so we need to set it up here.
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
{ 'mason-org/mason.nvim', opts = {} },
{ 'mason-org/mason-lspconfig.nvim', opts = {} },
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might need a brief explanation of why its needed.

It turns out, that's not necessarily clear, especially for newcomers, e.g.
https://www.reddit.com/r/neovim/comments/1pnqyi8/please_clarify_the_purpose_of_masonlspconfig/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mason-lspconfig enables auto-enable and enables the installing of LSP servers by configuration name.
eg. in nvim-lspconfig the configurations for lua-language-server is named lua_ls

so with mason-lspconfig you can :MasonInstall lua_ls instead of lua-language-server which is actually done in kickstart.nvim

Copy link

@ro0gr ro0gr Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for my confusing comment then 😅

I mean it seems reasonable to supply this dependency with a comment explaining why it's needed, to avoid removing it again without a good reason veonim@ad246eb

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

Successfully merging this pull request may close these issues.

3 participants