mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(health): sort parser list for clarity
This commit is contained in:
parent
2ad12932a2
commit
e138c066f7
1 changed files with 4 additions and 2 deletions
|
|
@ -1570,12 +1570,14 @@ end
|
|||
-- Get a list of all available parsers
|
||||
---@return string[]
|
||||
function M.available_parsers()
|
||||
local parsers = vim.tbl_keys(M.list)
|
||||
table.sort(parsers)
|
||||
if vim.fn.executable "tree-sitter" == 1 and vim.fn.executable "node" == 1 then
|
||||
return vim.tbl_keys(M.list)
|
||||
return parsers
|
||||
else
|
||||
return vim.tbl_filter(function(p) ---@param p string
|
||||
return not M.list[p].install_info.requires_generate_from_grammar
|
||||
end, vim.tbl_keys(M.list))
|
||||
end, parsers)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue