mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 19:00:02 -04:00
Add an error message if NPM is not available but needed
This commit is contained in:
parent
1fa1ddea84
commit
f392f13af4
2 changed files with 4 additions and 1 deletions
|
|
@ -184,6 +184,10 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync,
|
||||||
end
|
end
|
||||||
if generate_from_grammar then
|
if generate_from_grammar then
|
||||||
if repo.generate_requires_npm 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, {
|
vim.list_extend(command_list, {
|
||||||
{
|
{
|
||||||
cmd = 'npm',
|
cmd = 'npm',
|
||||||
|
|
|
||||||
|
|
@ -433,7 +433,6 @@ list.jsdoc = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/tree-sitter/tree-sitter-jsdoc",
|
url = "https://github.com/tree-sitter/tree-sitter-jsdoc",
|
||||||
files = { "src/parser.c" },
|
files = { "src/parser.c" },
|
||||||
requires_generate_from_grammar = true,
|
|
||||||
},
|
},
|
||||||
maintainers = {"@steelsojka"},
|
maintainers = {"@steelsojka"},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue