@@ -10,8 +10,51 @@ local function check_bin(name)
10
10
end
11
11
end
12
12
13
+ local function check_treesitter ()
14
+ local ok , parsers = pcall (require , " nvim-treesitter.parsers" )
15
+ if not ok then
16
+ health .error (" 'nvim-treesitter' is not installed" , {
17
+ " Install it: https://github.com/nvim-treesitter/nvim-treesitter" ,
18
+ })
19
+ return
20
+ end
21
+ if not parsers .has_parser (" java" ) then
22
+ health .error (" Tree-sitter parser for 'java' is missing" , {
23
+ " Run :TSInstall java" ,
24
+ })
25
+ else
26
+ health .ok (" Tree-sitter parser for 'java' is installed" )
27
+ end
28
+ health .warn (" Make sure Tree-sitter parser for 'java' is up-to-date" , {
29
+ " Run :TSUpdate java" ,
30
+ })
31
+ end
32
+
33
+ local function check_plugin (mod_name , repo_url )
34
+ local ok = pcall (require , mod_name )
35
+ if ok then
36
+ health .ok (string.format (" Plugin '%s' is installed" , mod_name ))
37
+ else
38
+ health .error (string.format (" Plugin '%s' is missing" , mod_name ), {
39
+ " Install it: https://github.com/" .. repo_url ,
40
+ })
41
+ end
42
+ end
43
+
13
44
return {
14
45
check = function ()
46
+ health .start (" Required plugin depencies:" )
47
+ check_plugin (" neotest" , " nvim-neotest/neotest" )
48
+ check_plugin (" nvim-treesitter" , " nvim-treesitter/nvim-treesitter" )
49
+ check_treesitter ()
50
+ check_plugin (" nio" , " nvim-neotest/nvim-nio" )
51
+ check_plugin (" plenary" , " nvim-lua/plenary.nvim" )
52
+ check_plugin (" jdtls" , " mfussenegger/nvim-jdtls" )
53
+ check_plugin (" dap" , " mfussenegger/nvim-dap" )
54
+ check_plugin (" dapui" , " rcarriga/nvim-dap-ui" )
55
+ check_plugin (" nvim-dap-virtual-text" , " theHamsta/nvim-dap-virtual-text" )
56
+
57
+ health .start (" Required binaries:" )
15
58
check_bin (binaries .java ())
16
59
check_bin (binaries .javac ())
17
60
end ,
0 commit comments