fix(checkhealth): error in node.js check #28348

Problem:
:checkhealth node.js check fails:

    ERROR Failed to run healthcheck for "provider.node" plugin ...
    node/health.lua:98: attempt to call local 'message' (a string value)

`message` is called as a function, when it is actually a string.

Solution:
Pass `message` to `warn()` as an argument.

Fix #28346
This commit is contained in:
Ivan Georgiev 2024-04-15 19:23:22 +03:00 committed by GitHub
parent 533e01a75b
commit 603f3b36a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 5 deletions

View File

@ -92,14 +92,15 @@ function M.check()
if latest_npm ~= 'unable to parse' and vim.version.lt(current_npm, latest_npm) then
local message = 'Package "neovim" is out-of-date. Installed: '
.. current_npm
.. ' latest: '
.. latest_npm
health.warn(message({
.. current_npm:gsub('%\n$', '')
.. ', latest: '
.. latest_npm:gsub('%\n$', '')
health.warn(message, {
'Run in shell: npm install -g neovim',
'Run in shell (if you use yarn): yarn global add neovim',
'Run in shell (if you use pnpm): pnpm install -g neovim',
}))
})
else
health.ok('Latest "neovim" npm/yarn/pnpm package is installed: ' .. current_npm)
end