summaryrefslogtreecommitdiffstats
path: root/tests/helpers/lua
Commit message (Collapse)AuthorAgeFilesLines
* refactor(registry): change lua registries to not instantiate Package themselvesWilliam Boman2025-05-024-21/+12
| | | | | | | | 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.
* refactor: standardize constructors and improve inheritance constructionWilliam Boman2025-02-193-3/+3
|
* refactor!: refactor installer internals and add new Package class methods ↵William Boman2025-02-192-70/+21
| | | | | | | | | | | | | | | | | | | (#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-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **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>
* style: enforce import order (#1092)William Boman2023-03-122-6/+6
| | | | | * chore(workflows): update dependencies * style: enforce import order
* feat: add github registry source capabilities (#1091)William Boman2023-03-125-0/+36
|
* fix: fix writing pyvenv module wrapper (#1073)William Boman2023-03-061-1/+1
| | | Closes #1071.
* feat(InstallContext): add strict_mode flag (#1055)William Boman2023-03-051-4/+4
| | | Also add some more ctx.fs methods.
* refactor(installer): introduce PackageInstallOpts class (#802)William Boman2022-12-261-1/+1
|
* refactor: store link state in install context object (#419)William Boman2022-09-141-0/+8
|
* refactor: introduce selene, harden type defs, and use proper EmmyLua syntax ↵William Boman2022-08-152-3/+7
| | | | (#296)
* chore: change emmylua annotation syntax from @ to : for comments (#73)William Boman2022-07-141-2/+2
|
* fix(api): fix the :MasonUninstall command (#66)William Boman2022-07-131-0/+14
|
* refactor: add mason-schemas and mason-core modules (#29)William Boman2022-07-083-5/+5
| | | | | * refactor: add mason-schemas and move generated filetype map to mason-lspconfig * refactor: add mason-core module
* refactor: move packages to mason-registry (#27)William Boman2022-07-081-3/+2
|
* mason.nvimWilliam Boman2022-07-073-48/+42
|
* chore: further decouple module structure (#685)William Boman2022-05-111-1/+1
|
* chore: remove deprecated modules (#682)William Boman2022-05-101-1/+0
| | | | - https://github.com/williamboman/nvim-lsp-installer/wiki/Async-infrastructure-changes-notice - https://github.com/williamboman/nvim-lsp-installer/discussions/636
* feat: allow excluding servers from automatic installation (#643)William Boman2022-04-301-2/+3
|
* switch majority of installers to async implementation (#574)William Boman2022-04-061-9/+12
|
* add async managers (#536)William Boman2022-03-262-0/+137