@@ -24,6 +24,7 @@ local lua_dependencies = {
24
24
25
25
--- @class rustaceanvim.ExternalDependency
26
26
--- @field name string Name of the dependency
27
+ --- @field required_version_spec ? string Version range spec. See ` vim.version.range()`
27
28
--- @field get_binaries fun (): string[] Function that returns the binaries to check for
28
29
--- @field is_installed ? fun ( bin : string ): boolean Default : ` vim.fn.executable (bin ) == 1`
29
30
--- @field optional fun (): boolean Function that returns whether the dependency is optional
@@ -63,6 +64,13 @@ local check_installed = function(dep)
63
64
if error_msg then
64
65
return false , binary , error_msg
65
66
end
67
+ if dep .required_version_spec then
68
+ local version_range = vim .version .range (dep .required_version_spec )
69
+ if version_range and not version_range :has (binary_version ) then
70
+ local msg = ' Unsuported version. Required ' .. dep .required_version_spec .. ' , but found ' .. binary_version
71
+ return false , binary , msg
72
+ end
73
+ end
66
74
return true , binary , binary_version
67
75
end
68
76
return false , binary , ' Unable to determine version.'
@@ -267,6 +275,22 @@ function health.check()
267
275
Set in the config to override the 'cargo' command for debugging and testing.
268
276
]] ,
269
277
})
278
+ elseif config .tools .enable_nextest then
279
+ table.insert (external_dependencies , {
280
+ name = ' cargo-nextest' ,
281
+ required_version_spec = ' >=0.9.81' ,
282
+ get_binaries = function ()
283
+ return { ' cargo-nextest' }
284
+ end ,
285
+ optional = function ()
286
+ return false
287
+ end ,
288
+ url = ' [cargo-nextest](https://nexte.st)' ,
289
+ info = [[
290
+ Next generation test runner for Rust projects.
291
+ Optional dependency, required if the 'tools.enable_nextest' option is set.
292
+ ]] ,
293
+ })
270
294
end
271
295
272
296
if adapter ~= false then
0 commit comments