commit 603f3b36a4d543bc539a5abad8ac93a2595e3995
parent 533e01a75b71e93686e7bc9c79fe0172ca876d91
Author: Ivan Georgiev <ivan_georgiew@yahoo.com>
Date: Mon, 15 Apr 2024 19:23:22 +0300
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
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/runtime/lua/provider/node/health.lua b/runtime/lua/provider/node/health.lua
@@ -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