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 5aa2984a02
commit cde679e435
15 changed files with 951 additions and 709 deletions

View file

@ -45,19 +45,6 @@ end, {
desc = 'Install treesitter parsers from grammar',
})
api.nvim_create_user_command('TSInstallSync', function(args)
require('nvim-treesitter.install').install(args.fargs, {
with_sync = true,
force = args.bang,
})
end, {
nargs = '+',
bang = true,
bar = true,
complete = complete_available_parsers,
desc = 'Install treesitter parsers synchronously',
})
api.nvim_create_user_command('TSUpdate', function(args)
require('nvim-treesitter.install').update(args.fargs)
end, {
@ -67,15 +54,6 @@ end, {
desc = 'Update installed treesitter parsers',
})
api.nvim_create_user_command('TSUpdateSync', function(args)
require('nvim-treesitter.install').update(args.fargs, { with_sync = true })
end, {
nargs = '*',
bar = true,
complete = complete_installed_parsers,
desc = 'Update installed treesitter parsers synchronously',
})
api.nvim_create_user_command('TSUninstall', function(args)
require('nvim-treesitter.install').uninstall(args.fargs)
end, {
@ -84,3 +62,9 @@ end, {
complete = complete_installed_parsers,
desc = 'Uninstall treesitter parsers',
})
api.nvim_create_user_command('TSLog', function()
require('nvim-treesitter.log').show()
end, {
desc = 'View log messages',
})