From 532a369b3267c144b294abcdf13b999e36e27e12 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Sun, 7 Mar 2021 17:05:16 +0100 Subject: Mark parsers with NPM dependency --- lua/nvim-treesitter/install.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lua/nvim-treesitter/install.lua') 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', -- cgit v1.2.3