mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
refactor: rewrite installation using jobs and async
Replace sync variants with callback support
This commit is contained in:
parent
5aa2984a02
commit
cde679e435
15 changed files with 951 additions and 709 deletions
|
|
@ -2,10 +2,8 @@
|
|||
vim.opt.runtimepath:append('.')
|
||||
|
||||
-- Load previous lockfile
|
||||
local filename = require('nvim-treesitter.shell_cmds').get_package_path('lockfile.json')
|
||||
local file = assert(io.open(filename, 'r'))
|
||||
local lockfile = vim.json.decode(file:read('*a'))
|
||||
file:close()
|
||||
local filename = require('nvim-treesitter.install').get_package_path('lockfile.json')
|
||||
local lockfile = vim.json.decode(require('nvim-treesitter.util').read_file(filename))
|
||||
|
||||
---@type string?
|
||||
local skip_lang_string = os.getenv('SKIP_LOCKFILE_UPDATE_FOR_LANGS')
|
||||
|
|
@ -47,6 +45,4 @@ end
|
|||
vim.print(lockfile)
|
||||
|
||||
-- write new lockfile
|
||||
file = assert(io.open(filename, 'w'))
|
||||
file:write(vim.json.encode(lockfile))
|
||||
file:close()
|
||||
require('nvim-treesitter.util').write_file(filename, vim.json.encode(lockfile))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue