File tree Expand file tree Collapse file tree 1 file changed +22
-13
lines changed Expand file tree Collapse file tree 1 file changed +22
-13
lines changed Original file line number Diff line number Diff line change 1- --- @param name string
2- local function parser_installed (name )
3- local ok = pcall (vim .treesitter .query .parse , name , ' ' )
4- if ok then
5- vim .health .ok (name .. ' parser installed' )
6- else
7- vim .health .error (name .. ' parser not found' )
8- end
9- end
10-
111local M = {}
122
133function M .check ()
14- vim .health .start (' Checking required treesitter parsers' )
15- parser_installed (' markdown' )
16- parser_installed (' markdown_inline' )
4+ vim .health .start (' Checking required treesitter parsers & settings' )
5+ local ok , ts = pcall (require , ' nvim-treesitter.parsers' )
6+ if not ok then
7+ vim .health .error (' treesitter is not installed' )
8+ return
9+ end
10+ vim .health .ok (' treesitter is installed' )
11+
12+ for _ , name in ipairs ({ ' markdown' , ' markdown_inline' }) do
13+ if ts .has_parser (name ) then
14+ vim .health .ok (name .. ' parser installed' )
15+ else
16+ vim .health .error (name .. ' parser not installed' )
17+ end
18+ end
19+
20+ local highlight = require (' nvim-treesitter.configs' ).get_module (' highlight' )
21+ if highlight .enable then
22+ vim .health .ok (' treesitter highlights enabled' )
23+ else
24+ vim .health .error (' treesitter highlights not enabled' )
25+ end
1726end
1827
1928return M
You can’t perform that action at this time.
0 commit comments