Fix #1324: tree-sitter CLI requires node

This commit is contained in:
Stephan Seitz 2021-06-03 00:04:39 +02:00 committed by Stephan Seitz
parent ad28bbf04c
commit 31f1125827

View file

@ -602,7 +602,7 @@ function M.ft_to_lang(ft)
end
function M.available_parsers()
if vim.fn.executable('tree-sitter') == 1 then
if vim.fn.executable('tree-sitter') == 1 and vim.fn.executable('node') == 1 then
return vim.tbl_keys(M.list)
else
return vim.tbl_filter(function(p) return not M.list[p].install_info.requires_generate_from_grammar end,
@ -611,7 +611,7 @@ function M.available_parsers()
end
function M.maintained_parsers()
local has_tree_sitter_cli = vim.fn.executable('tree-sitter') == 1
local has_tree_sitter_cli = vim.fn.executable('tree-sitter') == 1 and vim.fn.executable('node') == 1
return vim.tbl_filter(function(lang)
return M.list[lang].maintainers
and (has_tree_sitter_cli or not M.list[lang].install_info.requires_generate_from_grammar) end,