mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 12:50:09 -04:00
feat(install): allow pass callback to update()
Problem: cannot run `:TSUpdate synchronously` Solution: pass callback used after exiting jobs (like in `install-parsers`).
This commit is contained in:
parent
0d938bb340
commit
3ea0ee78de
1 changed files with 3 additions and 3 deletions
|
|
@ -455,8 +455,8 @@ end, 3)
|
|||
|
||||
---@param languages? string[]|string
|
||||
---@param _options? UpdateOptions
|
||||
---@param _callback function
|
||||
M.update = a.sync(function(languages, _options, _callback)
|
||||
---@param callback function
|
||||
M.update = a.sync(function(languages, _options, callback)
|
||||
reload_parsers()
|
||||
if not languages or #languages == 0 then
|
||||
languages = 'all'
|
||||
|
|
@ -465,7 +465,7 @@ M.update = a.sync(function(languages, _options, _callback)
|
|||
languages = vim.tbl_filter(needs_update, languages) ---@type string[]
|
||||
|
||||
if #languages > 0 then
|
||||
install(languages, { force = true })
|
||||
install(languages, { force = true }, callback)
|
||||
else
|
||||
log.info('All parsers are up-to-date')
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue