Skip to content

Commit 4604eba

Browse files
committed
test: try to install each parser
1 parent 8ea3dbe commit 4604eba

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

tests/mininit.lua

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,28 @@ function M.setup()
4646
-- Configure parser install directory for nvim-treesitter
4747
-- Try modern API first (nvim-treesitter.setup with install_dir)
4848
local ok, ts = pcall(require, 'nvim-treesitter')
49-
if ok and ts.setup then
50-
ok = pcall(ts.setup, {
51-
install_dir = parser_install_dir,
52-
})
53-
end
5449

5550
if not ok then
5651
print 'Could not set up tree sitter'
57-
process:exit(1)
52+
os.exit(1)
5853
end
5954

60-
ts.install({
55+
ts.setup { install_dir = parser_install_dir }
56+
57+
local parsers = {
6158
'html',
6259
'javascript',
6360
'typescript',
6461
'regex',
65-
}):wait(300000)
62+
}
63+
64+
for _, lang in ipairs(parsers) do
65+
if not pcall(function()
66+
ts.install(lang):wait(300000)
67+
end) then
68+
print('Failed to install language parser: ' .. lang)
69+
end
70+
end
6671
end
6772

6873
M.setup()

0 commit comments

Comments
 (0)