diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2021-03-07 17:05:16 +0100 |
|---|---|---|
| committer | Kiyan <yazdani.kiyan@protonmail.com> | 2021-03-16 18:52:43 +0100 |
| commit | 532a369b3267c144b294abcdf13b999e36e27e12 (patch) | |
| tree | 9f7fbab95689a0814320f8397e4c1682626c65db /lua/nvim-treesitter/install.lua | |
| parent | fcb6d74b6b24628cd1975a2f7c5d048bc73a9bab (diff) | |
Mark parsers with NPM dependency
Diffstat (limited to 'lua/nvim-treesitter/install.lua')
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 13 |
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', |
