diff --git a/lua/rustaceanvim/health.lua b/lua/rustaceanvim/health.lua index 851b66a4..a087e3a1 100644 --- a/lua/rustaceanvim/health.lua +++ b/lua/rustaceanvim/health.lua @@ -24,6 +24,7 @@ local lua_dependencies = { ---@class rustaceanvim.ExternalDependency ---@field name string Name of the dependency +---@field required_version_spec? string Version range spec. See `vim.version.range()` ---@field get_binaries fun():string[] Function that returns the binaries to check for ---@field is_installed? fun(bin: string):boolean Default: `vim.fn.executable(bin) == 1` ---@field optional fun():boolean Function that returns whether the dependency is optional @@ -63,6 +64,13 @@ local check_installed = function(dep) if error_msg then return false, binary, error_msg end + if dep.required_version_spec then + local version_range = vim.version.range(dep.required_version_spec) + if version_range and not version_range:has(binary_version) then + local msg = 'Unsuported version. Required ' .. dep.required_version_spec .. ', but found ' .. binary_version + return false, binary, msg + end + end return true, binary, binary_version end return false, binary, 'Unable to determine version.' @@ -267,6 +275,22 @@ function health.check() Set in the config to override the 'cargo' command for debugging and testing. ]], }) + elseif config.tools.enable_nextest then + table.insert(external_dependencies, { + name = 'cargo-nextest', + required_version_spec = '>=0.9.81', + get_binaries = function() + return { 'cargo-nextest' } + end, + optional = function() + return false + end, + url = '[cargo-nextest](https://nexte.st)', + info = [[ + Next generation test runner for Rust projects. + Optional dependency, required if the 'tools.enable_nextest' option is set. + ]], + }) end if adapter ~= false then diff --git a/lua/rustaceanvim/overrides.lua b/lua/rustaceanvim/overrides.lua index fb0317d1..1d2df3a7 100644 --- a/lua/rustaceanvim/overrides.lua +++ b/lua/rustaceanvim/overrides.lua @@ -49,7 +49,6 @@ function M.try_nextest_transform(args) table.remove(args, #args) end local nextest_unsupported_flags = { - '--exact', '--show-output', } local indexes_to_remove_reverse_order = {}