mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 04:50:03 -04:00
feat(install): allow specifying max jobs
This commit is contained in:
parent
ab230eadd4
commit
83dae49a10
2 changed files with 7 additions and 3 deletions
|
|
@ -23,7 +23,7 @@ local uv_symlink = a.wrap(uv.fs_symlink, 4)
|
|||
---@type fun(path: string): string?
|
||||
local uv_unlink = a.wrap(uv.fs_unlink, 2)
|
||||
|
||||
local MAX_JOBS = 10
|
||||
local MAX_JOBS = 100
|
||||
local INSTALL_TIMEOUT = 60000
|
||||
|
||||
---@async
|
||||
|
|
@ -402,6 +402,7 @@ end
|
|||
---@class InstallOptions
|
||||
---@field force? boolean
|
||||
---@field generate? boolean
|
||||
---@field max_jobs? integer
|
||||
|
||||
--- Install a parser
|
||||
---@param languages string[]
|
||||
|
|
@ -425,7 +426,7 @@ local function install(languages, options, _callback)
|
|||
end)
|
||||
end
|
||||
|
||||
a.join(MAX_JOBS, nil, tasks)
|
||||
a.join(options and options.max_jobs or MAX_JOBS, nil, tasks)
|
||||
if #tasks > 1 then
|
||||
a.main()
|
||||
log.info('Installed %d/%d languages', done, #tasks)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue