Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@williamboman williamboman released this 06 May 20:58
· 21 commits to main since this release
v2.0.0

2.0.0 (2025-05-06)

Update: Clarification
The following new requirements are in place:

  • Neovim v0.11 or later
  • Mason v2
  • nvim-lspconfig v2

mason-lspconfig.nvim now assumes usage of the new vim.lsp.config configuration mechanism. If you still haven't migrated to Neovim's new LSP configuration API, you're recommended to keep using the latest v1 releases, or the v1.x branches, of both mason.nvim and mason-lspconfig.nvim.

See:


This release adds support for the new native LSP configuration mechanism (see vim.lsp.config) added in Neovim v0.11.
As a result, some existing features have been removed and a new automatic_enable feature has been added.
mason-lspconfig.nvim now tries to get out of the way as much as possible and instead allow users to entirely rely on
the new LSP configuration mechanism, while providing some convenient QoL features on top.

Note

Not all LSP configurations in nvim-lspconfig have been migrated to vim.lsp.config yet. These servers will have to be
manually set up (require("lspconfig").apex_ls.setup {}). A full list may be found
here.

Repository has been moved

The repository has been transferred to the mason-org organization. The new URL is
https://github.com/mason-org/mason-lspconfig.nvim. The previous URL will continue to function as a redirect to the new
URL but users are recommended to update to the new location.

New location for server mappings

Server mappings are now hosted via the registry instead of bundled with mason-lspconfig.nvim itself.

Removed Features

  • Remove the handlers setting and .setup_handlers() function. It has been replaced by the new native
    vim.lsp.config() API and a new automatic_enable setting.
  • Remove the automatic_installation setting. This feature is no longer compatible with the new native LSP
    configuration mechanism.

New Features

  • Add new automatic_enable setting to automatically vim.lsp.enable() installed servers. It is by default activated.

Example Setup

-- Configure a server via `vim.lsp.config()` or `{after/}lsp/lua_ls.lua`
vim.lsp.config('lua_ls', {
  settings = {
    Lua = {
      runtime = {
        version = 'LuaJIT',
      },
      diagnostics = {
        globals = {
          'vim',
          'require',
        },
      },
    },
  },
})

require("mason").setup()
-- Note: `nvim-lspconfig` needs to be in 'runtimepath' by the time you set up mason-lspconfig.nvim
require("mason-lspconfig").setup {
  ensure_installed = { "lua_ls" }
}