aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/health.lua11
-rw-r--r--lua/nvim-treesitter/install.lua3
2 files changed, 14 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua
index b1c1a8f7a..33021e36d 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.',
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index 7d491549c..c1201af5f 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -169,6 +169,9 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync,
end
return
end
+ if generate_from_grammar and vim.fn.executable('node') ~= 1 then
+ api.nvim_err_writeln('node JS not found: `node` is not executable!')
+ end
local cc = shell.select_executable(M.compilers)
if not cc then
api.nvim_err_writeln('No C compiler found! "'