refactor: rewrite installation using jobs and async

Replace sync variants with callback support
This commit is contained in:
Lewis Russell 2023-05-22 14:35:25 +01:00 committed by Christian Clason
parent 52976802a5
commit 73ddd80069
15 changed files with 962 additions and 708 deletions

View file

@ -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