Skip to content

Commit

Permalink
feat(health): check for optional ra-multiplex dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jan 2, 2025
1 parent 618f274 commit f855920
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions lua/rustaceanvim/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,8 @@ local function check_external_dependency(dep)
end
return
end
if dep.optional() then
h.warn(([[
%s: not found.
Install %s for extended capabilities.
%s
]]):format(dep.name, dep.url, dep.info))
else
error(([[
if not dep.optional() then
h.error(([[
%s: not found: %s
rustaceanvim requires %s.
%s
Expand Down Expand Up @@ -230,6 +224,26 @@ function health.check()
end
end,
},
{
name = 'ra-multiplex',
get_binaries = function()
return { 'ra-multiplex' }
end,
is_installed = function(bin)
if type(vim.system) == 'function' then
local success = pcall(function()
vim.system { bin, '--version' }
end)
return success
end
return vim.fn.executable(bin) == 1
end,
optional = function()
return true
end,
url = '[ra-multiplex](https://github.com/pr2502/ra-multiplex)',
info = 'Multiplex server for rust-analyzer.',
},
{
name = 'Cargo',
get_binaries = function()
Expand Down

0 comments on commit f855920

Please sign in to comment.