diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2021-03-16 05:02:03 +0100 |
|---|---|---|
| committer | Kiyan <yazdani.kiyan@protonmail.com> | 2021-03-16 18:52:43 +0100 |
| commit | f392f13af41444920ebbb0a41f07a4843761abe6 (patch) | |
| tree | 9e5c067565f1f6eaf2741a7b7a348ea98dc4fb01 /lua | |
| parent | fix(CI): add brew update (diff) | |
| download | nvim-treesitter-f392f13af41444920ebbb0a41f07a4843761abe6.tar nvim-treesitter-f392f13af41444920ebbb0a41f07a4843761abe6.tar.gz nvim-treesitter-f392f13af41444920ebbb0a41f07a4843761abe6.tar.bz2 nvim-treesitter-f392f13af41444920ebbb0a41f07a4843761abe6.tar.lz nvim-treesitter-f392f13af41444920ebbb0a41f07a4843761abe6.tar.xz nvim-treesitter-f392f13af41444920ebbb0a41f07a4843761abe6.tar.zst nvim-treesitter-f392f13af41444920ebbb0a41f07a4843761abe6.zip | |
Add an error message if NPM is not available but needed
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 4 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 1 |
2 files changed, 4 insertions, 1 deletions
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"}, } |
