mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-06 05:20:00 -04:00
refactor: rewrite installation using jobs and async
Replace sync variants with callback support
This commit is contained in:
parent
52976802a5
commit
73ddd80069
15 changed files with 962 additions and 708 deletions
|
|
@ -1860,17 +1860,18 @@ M.configs = {
|
|||
---@param tier integer? only get parsers of specified tier
|
||||
---@return string[]
|
||||
function M.get_available(tier)
|
||||
--- @type string[]
|
||||
local parsers = vim.tbl_keys(M.configs)
|
||||
table.sort(parsers)
|
||||
if tier then
|
||||
parsers = vim.iter.filter(function(p)
|
||||
return M.configs[p].tier == tier
|
||||
end, parsers)
|
||||
end, parsers) --[[@as string[] ]]
|
||||
end
|
||||
if vim.fn.executable('tree-sitter') == 0 or vim.fn.executable('node') == 0 then
|
||||
parsers = vim.iter.filter(function(p)
|
||||
return not M.configs[p].install_info.requires_generate_from_grammar
|
||||
end, parsers)
|
||||
end, parsers) --[[@as string[] ]]
|
||||
end
|
||||
return parsers
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue