mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 03:26:52 -04:00
all/maintained: only installation from grammar when tree-sitter CLI executable
This commit is contained in:
parent
c16a6c972b
commit
25ee877b62
1 changed files with 11 additions and 2 deletions
|
|
@ -544,11 +544,20 @@ function M.ft_to_lang(ft)
|
|||
end
|
||||
|
||||
function M.available_parsers()
|
||||
return vim.tbl_keys(M.list)
|
||||
if vim.fn.executable('tree-sitter') == 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,
|
||||
vim.tbl_keys(M.list))
|
||||
end
|
||||
end
|
||||
|
||||
function M.maintained_parsers()
|
||||
return vim.tbl_filter(function(lang) return M.list[lang].maintainers end, M.available_parsers())
|
||||
local has_tree_sitter_cli = vim.fn.executable('tree-sitter') == 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,
|
||||
M.available_parsers())
|
||||
end
|
||||
|
||||
function M.get_parser_configs()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue