feat(install): Add a quite option to the install() method

This flag skips the "[nvim-treesitter]: Installed X/X languages"
message.

fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/7872
This commit is contained in:
orip 2025-05-28 23:53:32 +03:00
parent 024e6c5e46
commit dd0da420c2

View file

@ -431,6 +431,7 @@ end
---@field force? boolean ---@field force? boolean
---@field generate? boolean ---@field generate? boolean
---@field max_jobs? integer ---@field max_jobs? integer
---@field quiet? boolean
--- Install a parser --- Install a parser
---@async ---@async
@ -461,7 +462,9 @@ local function install(languages, options)
join(options and options.max_jobs or MAX_JOBS, task_funs) join(options and options.max_jobs or MAX_JOBS, task_funs)
if #task_funs > 1 then if #task_funs > 1 then
a.schedule() a.schedule()
log.info('Installed %d/%d languages', done, #task_funs) if not options.quiet then
log.info('Installing %d/%d languages', done, #task_funs)
end
end end
return done == #task_funs return done == #task_funs
end end