summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/health.lua
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-04-01 11:37:07 +0200
committerStephan Seitz <stephan.lauf@yahoo.de>2021-04-01 21:10:47 +0200
commitc16a6c972b0b60d1070568181234ab66e7ea570a (patch)
tree67feb504777230e1490202891d19b3bbcdbafa5c /lua/nvim-treesitter/health.lua
parent0f9bdb0939db0e73daacaef78c5ff16bd76f9e81 (diff)
Check for node-js on :TSInstallFromGrammar
Ref: https://github.com/nvim-treesitter/nvim-treesitter/issues/1121#issuecomment-811755767
Diffstat (limited to 'lua/nvim-treesitter/health.lua')
-rw-r--r--lua/nvim-treesitter/health.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua
index b1c1a8f7..33021e36 100644
--- a/lua/nvim-treesitter/health.lua
+++ b/lua/nvim-treesitter/health.lua
@@ -25,6 +25,17 @@ local function install_health()
health_ok('`tree-sitter` found '..version..' (parser generator, only needed for :TSInstallFromGrammar)')
end
+ if fn.executable('node') == 0 then
+ health_warn('`node` executable not found (only needed for :TSInstallFromGrammar,'..
+ ' not required for :TSInstall)')
+ else
+ local handle = io.popen('node --version')
+ local result = handle:read("*a")
+ handle:close()
+ local version = vim.split(result,'\n')[1]
+ health_ok('`node` found '..version..' (only needed for :TSInstallFromGrammar)')
+ end
+
if fn.executable('git') == 0 then
health_error('`git` executable not found.', {
'Install it with your package manager.',