aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-registry
Commit message (Collapse)AuthorAgeFilesLines
* fix(registry): ensure there's no duplicate registry entries (#1957)William Boman2025-05-195-4/+67
|
* docs: update references to mason-org/mason.nvim (#1925)William Boman2025-05-061-1/+1
|
* feat: associate package instances with registry source and record it in receiptWilliam Boman2025-05-065-10/+39
|
* refactor(registry): change lua registries to not instantiate Package themselvesWilliam Boman2025-05-023-23/+36
| | | | | | | | Instead of having Lua registries instantiate package instances themselves we now do it in the installer of Lua registry sources. This aligns the behaviour of the Lua registry protocol with the other registry protocols.
* fix(registry): fix registry.is_installed()William Boman2025-03-241-2/+2
|
* refactor(registry)!: add events "update:success", "update:start", ↵William Boman2025-03-032-7/+24
| | | | "update:progress" and "update:failed"
* refactor(registry): parallelize registry installationWilliam Boman2025-03-033-28/+68
|
* refactor(registry): refactor registry initializationWilliam Boman2025-03-036-298/+290
|
* refactor: turn StdioSink into a proper classWilliam Boman2025-02-191-1/+2
|
* refactor!: change Package APIWilliam Boman2025-02-193-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) ```
* refactor: standardize constructors and improve inheritance constructionWilliam Boman2025-02-196-22/+28
|
* refactor(path): use InstallLocation to produce paths, remove static path methodsWilliam Boman2025-02-192-5/+9
|
* refactor!: refactor installer internals and add new Package class methods ↵William Boman2025-02-191-2/+2
| | | | | | | | | | | | | | | | | | | (#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!: consolidate Lua registry sources and the Package API (#1498)William Boman2025-02-162-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **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>
* feat(pypi): improve resolving suitable python version (#1725)William Boman2024-06-011-0/+2
|
* fix(registry): exhaust streaming parser when loading "file:" registries (#1708)William Boman2024-05-141-0/+9
|
* chore(registry): clean up recent changes (#1704)William Boman2024-05-111-18/+14
|
* 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.
* feat: add support for openvsx sources (#1589)William Boman2024-01-061-0/+9
|
* fix(registry): fix parsing registry identifiers that contain ":" (#1542)William Boman2023-10-311-1/+12
| | | | This primarily fixes `file:` registry identifiers on Windows that may include a drive letter (e.g. `file:C:\Users\user\AppData\Local\nvim`).
* fix(registry): reset registries state when setting registries (#1474)William Boman2023-08-271-0/+1
| | | | This should only be called once (during mason.nvim setup), but this fixes potential duplicate registry registration in cases where it's called > 1 times.
* refactor(registry): colocate FileRegistrySource buffer management (#1473)William Boman2023-08-271-6/+4
|
* fix(registry): schedule vim.fn calls in FileRegistrySource (#1471)William Boman2023-08-271-0/+1
|
* feat(registry): add file: source protocol (#1457)William Boman2023-08-264-40/+204
|
* fix(sources): don't skip installation if fixed version is not currently ↵William Boman2023-05-111-2/+2
| | | | installed (#1297)
* feat(registry): add .get_all_package_specs() (#1247)William Boman2023-04-223-19/+49
| | | | This is a faster method than .get_all_packages() due to the fact that it only loads package specifications without instantiating mason-core.package instances. Useful for situations where one only needs to read spec data.
* chore: remove lua:mason-registry.index registry entry (#1243)William Boman2023-04-211-3/+1
|
* chore: migrate verible (#1235)William Boman2023-04-182-104/+1
|
* chore: migrate haskell-language-server (#1230)William Boman2023-04-182-56/+0
|
* chore: migrate r-languageserver (#1222)William Boman2023-04-162-88/+0
|
* chore: migrate julia-lsp (#1217)William Boman2023-04-152-87/+0
|
* chore: migrate packages (#1203)William Boman2023-04-1196-2090/+1
|
* feat(registry): pcall require Lua registry packages (#1200)William Boman2023-04-081-1/+8
| | | | The index table may get out of date if a user updates the plugin version without restarting Neovim, causing the `require()` call to error (note, restarting Neovim after plugin updates is always a good idea).
* chore: migrate packages (#1198)William Boman2023-04-0830-768/+0
|
* fix(windows): download registry archive to file instead of piping data (#1189)William Boman2023-04-071-5/+7
| | | | Accessing binary data from the stdout of pwsh.exe's iwr seems to be causing data corruption leading to inability to unpack the archive.
* chore: migrate packages (#1182)William Boman2023-04-0530-783/+0
|
* feat(registry): add ability to register package aliases (#1146)elky2023-04-051-0/+21
|
* fix(github): fall back to curl/wget if gh is not available (#1181)William Boman2023-04-051-1/+0
|
* feat: vendor zzlib for unzip (#1174)William Boman2023-04-031-26/+13
| | | Download data of the registry suggest that ~10-18% struggle to unpack the registry archive, with the drop-off occurring in the `unzip` step. Being able to unpack the registry is a very crucial component of mason.nvim, which warrants vendoring [zzlib](https://github.com/zerkman/zzlib) to allow unpacking it entirely in Lua.
* chore: migrate packages (#1173)William Boman2023-04-0330-639/+0
|
* refactor: only schedule in a.scheduler() when in fast event (#1170)William Boman2023-04-022-9/+3
| | | Explicitly schedule via `a.wait(vim.schedule)` instead.
* fix(registry): use oneshot channel for updating registry (#1168)William Boman2023-04-022-19/+40
|
* feat(ui): display warning and error message if registry is not installed (#1164)William Boman2023-04-011-1/+5
|
* chore: migrate packages (#1163)William Boman2023-04-0130-563/+0
|
* chore: migrate packages (#1161)William Boman2023-03-3130-667/+0
|
* chore: migrate packages (#1148)William Boman2023-03-2930-634/+0
|
* chore: migrate rust-analyzer (#1144)William Boman2023-03-272-54/+0
|
* chore: migrate packages (#1141)William Boman2023-03-269-209/+0
|
* refactor: download checksum after unzip (#1135)William Boman2023-03-251-8/+7
| | | | | | | | | * refactor: download checksum after unzip * fixup --------- Co-authored-by: williambotman[bot] <william+bot@redwill.se>
* chore: migrate lua-language-server (#1127)William Boman2023-03-232-65/+0
| | | Closes #995.