File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
6671end
6772
6873M .setup ()
You can’t perform that action at this time.
0 commit comments