summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/install.lua
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-03-16 05:02:03 +0100
committerKiyan <yazdani.kiyan@protonmail.com>2021-03-16 18:52:43 +0100
commitf392f13af41444920ebbb0a41f07a4843761abe6 (patch)
tree9e5c067565f1f6eaf2741a7b7a348ea98dc4fb01 /lua/nvim-treesitter/install.lua
parent1fa1ddea848cc0996c36c9ed2a80fd036385cd2e (diff)
Add an error message if NPM is not available but needed
Diffstat (limited to 'lua/nvim-treesitter/install.lua')
-rw-r--r--lua/nvim-treesitter/install.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index 655e82a3..7380934e 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -184,6 +184,10 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync,
end
if generate_from_grammar then
if repo.generate_requires_npm then
+ if not vim.fn.executable('npm') ~= 1 then
+ api.nvim_err_writeln('`'..lang..'` requires NPM to be installed from grammar.js')
+ return
+ end
vim.list_extend(command_list, {
{
cmd = 'npm',