From f392f13af41444920ebbb0a41f07a4843761abe6 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Tue, 16 Mar 2021 05:02:03 +0100 Subject: Add an error message if NPM is not available but needed --- lua/nvim-treesitter/install.lua | 4 ++++ lua/nvim-treesitter/parsers.lua | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 655e82a32..7380934e7 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', diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 4cc34d176..4a021df01 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -433,7 +433,6 @@ list.jsdoc = { install_info = { url = "https://github.com/tree-sitter/tree-sitter-jsdoc", files = { "src/parser.c" }, - requires_generate_from_grammar = true, }, maintainers = {"@steelsojka"}, } -- cgit v1.2.3-70-g09d2