refactor(health): use vim.system():wait() #34702

Problem:
- The ripgrep probe still used the legacy `vim.fn.system()`

Solution:
- Replace `vim.fn.system()` with `vim.system({rg_path, '-V'}):wait()`
This commit is contained in:
Tom Ampuero
2025-06-29 15:56:44 +01:00
committed by GitHub
parent 1c52e90cd5
commit 2f95abddfa

View File

@ -399,10 +399,13 @@ local function check_external_tools()
health.start('External Tools')
if vim.fn.executable('rg') == 1 then
local rg = vim.fn.exepath('rg')
local cmd = 'rg -V'
local out = vim.fn.system(vim.fn.split(cmd))
health.ok(('%s (%s)'):format(vim.trim(out), rg))
local rg_path = vim.fn.exepath('rg')
local rg_job = vim.system({ rg_path, '-V' }):wait()
if rg_job.code == 0 then
health.ok(('%s (%s)'):format(vim.trim(rg_job.stdout), rg_path))
else
health.warn('found `rg` but failed to run `rg -V`', { rg_job.stderr })
end
else
health.warn('ripgrep not available')
end