Skip to content

Releases: mason-org/mason.nvim

v2.0.0

06 May 20:57
v2.0.0
Compare
Choose a tag to compare

2.0.0 (2025-05-06)

This release has been an ongoing effort for quite some time now and is now ready for release. Most users should not
experience any breaking changes.
If you use any of the Lua APIs that Mason provides you'll find an outline of the
changes below, breaking changes are marked with Breaking Change.

Repository has been moved

The repository has been transferred to the mason-org organization. The new URL is
https://github.com/mason-org/mason.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.

Addition of new maintainers ❤️

Features

  • Symlinks now uses relative paths instead of absolute paths.
  • Uninstalled packages now display their available version in the :Mason UI.
  • Packages in the :Mason UI now display the source purl.
  • Official support for custom registries.
  • Make registry installations run concurrently.
  • Add support for 'winborder'.
  • Display current mason.nvim version in the :Mason UI header.

Bug Fixes

  • Only attempt unlinking package if the receipt is found.
  • Expand executable paths on Windows before passing to uv_spawn.
  • Fix initializing UI state when using multiple registries.
  • Fix the display of outdated packages in the Mason UI under certain conditions.

Misc

  • Breaking Change Minimum Neovim requirement changed from 0.7.0 to 0.10.0.
  • Breaking Change APIs related to custom packages written in Lua has been removed.
    • All require("mason-core.installer.managers") modules have been removed.
    • The package structure of Lua packages has changed, refer to custom
      registries
      for information on how to continue using custom
      packages in Lua.

Event changes

Package

  • Breaking Change install:success now provides the receipt as payload argument.
  • Breaking Change install:failed now provides the error as payload argument.
  • Breaking Change uninstall:success now provides the receipt of the uninstalled package as payload argument.
  • uninstall:failed is now emitted when package uninstallation fails.

Registry

  • Breaking Change package:install:success now provides the receipt as payload argument.
  • Breaking Change package:install:failed now provides the error as payload argument.
  • Breaking Change package:uninstall:success now provides the receipt of the uninstalled package as payload argument.
  • package:uninstall:failed is now emitted when package uninstallation fails.
  • Breaking Change update is no longer emitted when registry is updated. It's replaced by the following events:
    • update:start when the registry starts updating
    • update:success when the registry is successfully updated
    • update:failed when the registry failed to update
    • update:progress is emitted when the registry update process makes progress when multiple registries are used

Package API changes

Package:get_install_path() has been removed.

Breaking Change

This method has been removed to prepare for future changes.

If you're using this method to access an executable, please consider simply using the canonical name of the executable
as Mason adds these to your PATH by default. If you're using the method to access other files inside the package,
please consider accessing the $MASON/share directory instead.

Example:

Clarification: The $MASON environment variable has been available since v1.0.0.

-- 1a. There's no need to reach into the package directory via Package:get_install_path() to access the executable
print(vim.fn.exepath("kotlin-debug-adapter"))
-- /Users/william/.local/share/nvim/mason/bin/kotlin-debug-adapter

-- 1b. Alternatively if you've configured Mason to not modify PATH
print(vim.fn.expand("$MASON/bin/kotlin-debug-adapter"))
-- /Users/william/.local/share/nvim/mason/bin/kotlin-debug-adapter

-- 2. To access other files inside the package directory, consider accessing them via the share/ directory
vim.print(vim.fn.globpath("$MASON/share/java-debug-adapter", "*.jar", true, true))
-- { "/Users/william/.local/share/nvim/mason/share/java-debug-adapter/com.microsoft.java.debug.plugin-0.53.1.jar", "/Users/william/.local/share/nvim/mason/share/java-debug-adapter/com.microsoft.java.debug.plugin.jar" }

-- 3. If you absolutely need to access the package directory (please consider raising an issue/PR in the registry if possible)
print(vim.fn.expand("$MASON/packages/kotlin-debug-adapter/adapter/bin/kotlin-debug-adapter"))
-- /Users/william/.local/share/nvim/mason/packages/kotlin-debug-adapter/adapter/bin/kotlin-debug-adapter

Note

Why was this method removed? The contents of the package directory is not a stable interface and its structure may
change without prior notice, for example to host multiple versions of a package. The only stable interfaces on the
file system are files available in bin/, share/ and opt/ - these directories are only subject to breaking
changes done by the underlying package itself.


Package:uninstall(opts, callback) is now asynchronous.

Breaking Change

This method now provides an asynchronous interface and accepts two new optional arguments opts and callback. opts
currently doesn't have any valid values other than an empty Lua table {}. callback is called when the package is
uninstalled, successfully or not. While the uninstall mechanism under the hood remains synchronous for the time being it
is not a guarantee going forward and users are recommended to always use the asynchronous version.

Example:

local registry = require("mason-registry")
local pkg = registry.get_package("lua-language-server")

pkg:uninstall({}, function (success, result)
    if success then
        -- Do something on success.
    else
        -- Do something on error.
    end
end)

Package:check_new_version() has been removed.

Breaking Change

Package:check_new_version() is replaced by Package:get_latest_version(). Package:get_latest_version() is a
synchronous API.

Note

Similarly to before, this function returns the package version provided by the currently installed registry version.

Example:

local registry = require("mason-registry")
local pkg = registry.get_package("lua-language-server")
local latest_version = pkg:get_latest_version()

Package:get_installed_version() is now synchronous.

Breaking Change

This function no longer accepts a callback.

Example:

local registry = require("mason-registry")
local pkg = registry.get_package("lua-language-server")
if pkg:is_installed() then
    local installed_version = pkg:get_installed_version()
end

Package:install() will now error if the package is currently being installed.

Breaking Change

Use the new Package:is_installing() method to check whether an installation is already running.


Package:uninstall() will now error if the package is not already installed.

Breaking Change

Use the new Package:is_installed() method to check whether the package is installed.


Package:install(opts, callback) now accepts a callback.

This optional callback is called by Mason when package installation finishes, successfully or not.

Example:

local registry = require("mason-registry")
local pkg = registry.get_package("lua-language-server")

pkg:install({}, function (success, result)
    if success then
        -- Do something on success.
    else
        -- Do something on error.
    end
end)

Custom registries

v2.0.0 introduces official support for custom registries. Currently supported registry protocols are github:, file:,
and lua:. Lua-based registries have been reworked, please see https://github.com/mason-org/registry-examples for examples.

Thanks to all sponsors who continue to help finance monthly costs and all 181 contributors of mason.nvim and 246
contributors of the core registry!

v2.0.0-rc.2

03 Mar 16:05
v2.0.0-rc.2
Compare
Choose a tag to compare
v2.0.0-rc.2 Pre-release
Pre-release

See #1884 for release notes.

v2.0.0-rc.1

19 Feb 14:05
v2.0.0-rc.1
Compare
Choose a tag to compare
v2.0.0-rc.1 Pre-release
Pre-release

See #1884 for release notes.

v1.11.0

15 Feb 22:14
fc98833
Compare
Choose a tag to compare

1.11.0 (2025-02-15)

Features

Bug Fixes

  • avoid calling vim.fn in fast event (#1878) (3a444cb)
  • avoid calling vim.fn.has inside fast event (#1705) (1b3d604)
  • fix usage of deprecated Neovim APIs (#1703) (0f1cb65)
  • fs: fall back to fs_stat if entry type is not returned by fs_readdir (#1783) (1114b23)
  • health: support multidigit luarocks version numbers (#1648) (751b1fc)
  • pypi: allow access to system site packages by default (#1584) (2be2600)
  • pypi: exclude python3.12 from candidate list (#1722) (f8ce876)
  • pypi: prefer stock python3 if it satisfies version requirement (#1736) (f96a318)
  • registry: exhaust streaming parser when loading "file:" registries (#1708) (49ff59a)
  • replace deprecated calls to vim.validate (#1876) (5664dd5)
  • ui: fix rendering JSON schemas (#1757) (e2f7f90)
  • ui: reposition window if border is different than "none" (#1859) (f9f3b46)

Performance Improvements

  • registry: significantly improve the "file:" protocol performance (#1702) (098a56c)

v1.10.0

29 Jan 06:30
c43eeb5
Compare
Choose a tag to compare

1.10.0 (2024-01-29)

Features

  • don't use vim.g.python3_host_prog as a candidate for python (#1606) (bce96d2)
  • pypi: attempt more python3 candidates (#1608) (dcd0ea3)

Bug Fixes

  • golang: fix fetching package versions for packages containing subpath specifier (#1607) (9c94168)
  • pypi: fix variable shadowing (#1610) (aa550fb)
  • ui: don't indent empty lines (#1597) (c7e6705)

v1.9.0

06 Jan 08:12
baf99d9
Compare
Choose a tag to compare

1.9.0 (2024-01-06)

Features

Bug Fixes

  • cargo: don't attempt to fetch versions when version targets commit SHA (#1585) (a09da6a)

v1.8.3

08 Nov 16:47
41e75af
Compare
Choose a tag to compare

1.8.3 (2023-11-08)

Bug Fixes

  • pypi: support MSYS2 virtual environments on Windows (#1547) (3e2432a)

v1.8.2

31 Oct 14:57
eabf6d3
Compare
Choose a tag to compare

1.8.2 (2023-10-31)

Bug Fixes

  • registry: fix parsing registry identifiers that contain ":" (#1542) (87eb3ac)

v1.8.1

10 Oct 12:05
cd7835b
Compare
Choose a tag to compare

1.8.1 (2023-10-10)

Bug Fixes

v1.8.0

10 Sep 22:02
d66c60e
Compare
Choose a tag to compare

1.8.0 (2023-09-04)

Features

Bug Fixes

  • registry: reset registries state when setting registries (#1474) (c811fbf)
  • registry: schedule vim.fn calls in FileRegistrySource (#1471) (1c77412)