aboutsummaryrefslogtreecommitdiffstats
path: root/lua
Commit message (Collapse)AuthorAgeFilesLines
* chore: remove unnecessary vim.schedule and nvim_err_writelnWilliam Boman2025-02-191-4/+1
|
* refactor: turn StdioSink into a proper classWilliam Boman2025-02-1919-119/+159
|
* feat(context): add ctx:fetch()William Boman2025-02-191-0/+12
|
* feat(ui): display latest version for uninstalled packagesWilliam Boman2025-02-191-0/+3
|
* fix(expr): also interpolate table keysWilliam Boman2025-02-191-0/+3
|
* refactor!: change Package APIWilliam Boman2025-02-1928-519/+848
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the following public APIs: **(_breaking_) Events on the `Package` class** The `uninstall:success` event on the `Package` class now receives an `InstallReceipt` as argument, instead of an `InstallHandle`. This receipt is an in-memory representation of what was uninstalled. There's also a new `uninstall:failed` event for situations where uninstallation for some reason fails. Note: this also applies to the registry events (i.e. `package:uninstall:success` and `package:uninstall:failed`). --- **(_breaking_) `Package:uninstall()` is now asynchronous and receives two new arguments, similarly to `Package:install()`** While package uninstallations remain synchronous under the hood, the public API has been changed from synchronous -> asynchronous. Users of this method are recommended to provide a callback in situations where code needs to execute after uninstallation fully completes. --- **(_breaking_) `Package:get_install_path()` has been removed. --- **`Package:install()` now takes an optional callback** This callback allows consumers to be informed whether installation was successful or not without having to go through a different, low-level, API. See below for a comparison between the old and new APIs: ```lua -- before local handle = pkg:install() handle:once("closed", function () -- ... end) -- after pkg:install({}, function (success, result) -- ... end) ```
* fix(pypi): remove -U flag and fix log messageWilliam Boman2025-02-191-2/+1
|
* fix(async): also check async context termination immediately after suspendingWilliam Boman2025-02-192-2/+5
|
* refactor: standardize constructors and improve inheritance constructionWilliam Boman2025-02-1924-141/+206
|
* fix(location): use correct registry pathWilliam Boman2025-02-191-1/+1
|
* feat(linker): use relative targets for symlinks (#1525)William Boman2025-02-192-24/+11
| | | | Closes #1156.
* feat(path): add relative(from, to)William Boman2025-02-191-1/+32
|
* refactor(path): use InstallLocation to produce paths, remove static path methodsWilliam Boman2025-02-198-70/+75
|
* refactor(installer): move initializations to InstallContext constructorWilliam Boman2025-02-195-29/+26
|
* refactor: add InstallLocation.global()William Boman2025-02-192-1/+6
|
* chore: hoist single file modulesWilliam Boman2025-02-192-0/+0
|
* fix(command): don't attempt installing packages that are already installingWilliam Boman2025-02-191-8/+13
|
* chore: remove todo commentWilliam Boman2025-02-191-1/+0
| | | | Using sync is actually preferable here (and likely in many other places) to avoid async context & continuation overhead.
* chore(compilers): remove default environment from github build compilerWilliam Boman2025-02-191-7/+1
|
* refactor!: refactor installer internals and add new Package class methods ↵William Boman2025-02-1934-584/+701
| | | | | | | | | | | | | | | | | | | (#1523) This contains the following changes: 1) `Package:install()` now accepts a second, optional, callback argument which is called when installation finishes (successfully or not). 2) Adds a `Package:is_installing()` method. This contains the following breaking changes: 1) `Package:install()` will now error when called while an installation is already ongoing. Use the new `Package:is_installing()` method to check whether an installation is already running. This also refactors large portions of the tests by removing test globals, removing async_test, and adding the `mason-test` Lua module instead. Test helpers via globals are problematic to work with due to not being detected through tools like the Lua language server without additional configuration. This has been replaced with a Lua module `mason-test`. `async_test` has also been removed in favour of explicitly making use of the `mason-core.async` API. These changes stands for a significant portion of the diff.
* refactor(receipt): change receipt structure and remove old builder APIs (#1521)William Boman2025-02-166-101/+50
|
* fix(package): support older receipt structures (#1520)William Boman2025-02-161-1/+5
|
* fix(ui): change feedback text contents when updating registry (#1519)William Boman2025-02-161-1/+1
|
* refactor(providers): inline GitHub API calls in the client provider (#1518)William Boman2025-02-162-47/+33
|
* feat!: upgrade minimum required neovim version to 0.9.0 (#1517)William Boman2025-02-161-3/+3
|
* fix(installer): schedule back to main loop before executing installer ↵William Boman2025-02-161-0/+1
| | | | functions (#1516)
* refactor!: consolidate Lua registry sources and the Package API (#1498)William Boman2025-02-1611-270/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **This removes the following APIs:** - `Package:check_new_version()`. Instead use the new `Package:get_latest_version()`. **This has a breaking change in the following APIs:** - `Package:get_installed_version()` now no longer takes a callback but instead returns the installed version or `nil` if not installed. <details> <summary>To handle these breaking changes in plugins, leverage the `mason.version` module, for example:</summary> ```lua local mason_version = require("mason.version") local registry = require("mason-registry") local pkg = registry.get_package("rust-analyzer") if mason_version.MAJOR_VERSION < 2 then -- before pkg:check_new_version(function (success, new_version) -- … end) pkg:get_installed_version(function (success, installed_version) -- … end) else -- after local new_version = pkg:get_latest_version() local installed_version = pkg:get_installed_version() fi ``` </details> --- <details> <summary>This change also introduces breaking changes for Lua registry sources, by consolidating the package schema with the registry.</summary> The following is an example of a package defined in a Lua registry, following the new schema: ```lua local Pkg = require("mason-core.package") return Pkg.new { schema = "registry+v1", name = "ripgrep", description = "ripgrep recursively searches directories for a regex pattern while respecting your gitignore.", homepage = "https://github.com/BurntSushi/ripgrep", licenses = { Pkg.License.MIT }, languages = {}, categories = {}, source = { id = "pkg:mason/ripgrep@13.0.0", ---@param ctx InstallContext ---@param purl Purl install = function(ctx, purl) -- Arbitrary installation code. end, }, bin = { rg = "./bin/rg", }, } ``` </details>
* refactor!: remove old managers (#1497)William Boman2025-02-1620-1809/+15
|
* chore(main): release 1.11.0 (#1658)v1.11.0v1.xwilliambotman[bot]2025-02-151-2/+2
|
* feat(ui): add backdrop (#1759)Hung Vu2025-02-153-18/+56
| | | | | | | | | | | | | | | Adds a backdrop for the Mason window. Can be disabled by setting the `ui.backdrop` option: ```lua require("mason").setup { ui = { backdrop = 100 } } ``` The backdrop is not displayed if `'termguicolors'` is not enabled or if Neovim is transparent. Co-authored-by: William Boman <william@redwill.se>
* fix(fs): fall back to `fs_stat` if entry type is not returned by ↵Nicolas Thierry2025-02-151-0/+7
| | | | | `fs_readdir` (#1783) Co-authored-by: William Boman <william@redwill.se>
* fix: avoid calling vim.fn in fast event (#1878)William Boman2025-02-152-3/+5
|
* fix(ui): reposition window if border is different than "none" (#1859)Pedro Gabriel de Morais Ribeiro2025-02-151-5/+7
| | | Co-authored-by: William Boman <william@redwill.se>
* fix: replace deprecated calls to vim.validate (#1876)Mark Sommers2025-02-151-20/+23
| | | Co-authored-by: William Boman <william@redwill.se>
* fix(ui): fix rendering JSON schemas (#1757)William Boman2024-07-161-2/+4
| | | Fixes #1741.
* fix(pypi): prefer stock python3 if it satisfies version requirement (#1736)Inhyuk Cho2024-07-091-2/+4
|
* fix(pypi): allow access to system site packages by default (#1584)Silico_Biomancer2024-07-071-1/+2
| | | Co-authored-by: William Boman <william@redwill.se>
* feat(pypi): improve resolving suitable python version (#1725)William Boman2024-06-017-17/+170
|
* fix(pypi): exclude python3.12 from candidate list (#1722)William Boman2024-05-311-1/+0
| | | Support for python3.12 among pypi packages is pretty poor, this limits the upper bound to python3.11 instead.
* fix(registry): exhaust streaming parser when loading "file:" registries (#1708)William Boman2024-05-141-0/+9
|
* fix: avoid calling vim.fn.has inside fast event (#1705)William Boman2024-05-121-3/+1
| | | | When this module is lazily required inside functional/init.lua we may be inside a fast event, causing the module to fail to load due to the top-level call to vim.fn.has.
* chore(registry): clean up recent changes (#1704)William Boman2024-05-111-18/+14
|
* fix: fix usage of deprecated Neovim APIs (#1703)William Boman2024-05-117-7/+32
|
* perf(registry): significantly improve the "file:" protocol performance (#1702)William Boman2024-05-111-30/+66
| | | | | | | | | | Instead of spawning a separate yq process for each registry package, utilize multi-document parsing through a single process. This should have significant performance improvements on all platforms, but especially Windows, due to bottlenecks caused by AV software. IMPORTANT: Writing all package definitions as-is via stdin like this works because packages in the registry (at least the core registry) must start with a document header (---), effectively acting as a document separator.
* fix(health): support multidigit luarocks version numbers (#1648)Eris2024-03-211-1/+1
|
* chore(main): release 1.10.0 (#1605)v1.10.0williambotman[bot]2024-01-291-2/+2
|
* fix(pypi): fix variable shadowing (#1610)William Boman2024-01-291-1/+3
|
* feat(pypi): attempt more python3 candidates (#1608)William Boman2024-01-251-12/+59
|
* fix(golang): fix fetching package versions for packages containing subpath ↵William Boman2024-01-221-1/+1
| | | | specifier (#1607)
* feat: don't use vim.g.python3_host_prog as a candidate for python (#1606)William Boman2024-01-213-28/+2
| | | | This is inconsistent with how other system dependencies are resolved and is not documented anywhere.