Skip to content

Commit 78257e4

Browse files
committed
test: don't need fancy wait anymore
nvim-treesitter's install function will fall back to compiling when ts cli is unavailable. this doens't work for whatever reason. Instead, we just installed ts cli in ci
1 parent 01ea5f0 commit 78257e4

1 file changed

Lines changed: 7 additions & 40 deletions

File tree

tests/bootstrap.lua

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,10 @@ Setup.load 'nvim-treesitter/nvim-treesitter'
66

77
Setup.setup()
88

9-
local parsers = { 'html', 'javascript', 'typescript', 'regex' }
10-
11-
-- Setup is already called in Setup.setup(), so install_dir is configured
12-
-- Just verify the config
13-
local config = require('nvim-treesitter.config')
14-
local parser_dir = config.get_install_dir('parser')
15-
print('Parser install directory: ' .. parser_dir)
16-
17-
-- Install parsers using the async API, but poll for actual file existence
18-
local install = require('nvim-treesitter.install')
19-
20-
for _, lang in ipairs(parsers) do
21-
local parser_file = parser_dir .. '/' .. lang .. '.so'
22-
23-
if vim.fn.filereadable(parser_file) ~= 1 then
24-
print('Installing ' .. lang .. '...')
25-
26-
-- Start async installation
27-
local task = install.install({ lang }, { summary = false })
28-
29-
-- We need to keep the async task running by either:
30-
-- 1. Calling task:wait() to process the event loop, OR
31-
-- 2. Manually processing events with vim.wait()
32-
--
33-
-- The task won't complete until we yield control.
34-
-- So we wait on the task itself, then verify the file exists
35-
if task and task.wait then
36-
task:wait(30000) -- This processes async events
37-
end
38-
39-
-- Now verify the file actually exists
40-
if vim.fn.filereadable(parser_file) ~= 1 then
41-
error(string.format('%s parser .so file not found at %s', lang, parser_file))
42-
end
43-
44-
print(lang .. ' parser installed')
45-
end
46-
end
47-
48-
print('All parsers ready')
9+
local ts = require 'nvim-treesitter'
10+
ts.install({
11+
'html',
12+
'javascript',
13+
'typescript',
14+
'regex',
15+
}):wait(10000)

0 commit comments

Comments
 (0)