summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/install.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-treesitter/install.lua')
-rw-r--r--lua/nvim-treesitter/install.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index ff43bca9..09eeb1d8 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -174,6 +174,19 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync,
vim.list_extend(command_list, shell.select_download_commands(repo, project_name, cache_folder, revision))
end
if generate_from_grammar then
+ if repo.generate_requires_npm then
+ vim.list_extend(command_list, {
+ {
+ cmd = 'npm',
+ info = 'Installing NPM dependencies of '..lang..' parser',
+ err = 'Error during `npm install` (required for parser generation of '..lang..' with npm dependencies)',
+ opts = {
+ args = {'install'},
+ cwd = compile_location
+ }
+ }
+ })
+ end
vim.list_extend(command_list, {
{
cmd = 'tree-sitter',