mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 13:00:08 -04:00
Fix #1324: tree-sitter CLI requires node
This commit is contained in:
parent
ad28bbf04c
commit
31f1125827
1 changed files with 2 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue