File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,13 +8,18 @@ utils.parser_installed = function (parser_name)
88 local has_ts , parsers = pcall (require , " nvim-treesitter.parsers" );
99
1010 if has_ts == false then
11- --- `nvim-treesitter` not available.
11+ -- `nvim-treesitter` not available.
1212 return false ;
13- elseif parsers .has_parser (parser_name ) == true then
14- --- Parser installed via `nvim-treesitter`.
13+ elseif parsers .has_parser and parsers .has_parser (parser_name ) == true then
14+ -- Parser installed via `nvim-treesitter`.
15+ -- NOTE: This only works for `master` branch.
16+ return true ;
17+ elseif parsers [parser_name ] then
18+ -- Parser installed via `nvim-treesitter`.
19+ -- NOTE: This only works for `main` branch.
1520 return true ;
1621 elseif pcall (vim .treesitter .query .get , parser_name , " highlights" ) == true then
17- --- Parser installed manually.
22+ -- Parser installed ` manually` .
1823 return true ;
1924 end
2025
You can’t perform that action at this time.
0 commit comments