-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathstartup-check.lua
More file actions
53 lines (42 loc) · 1.08 KB
/
startup-check.lua
File metadata and controls
53 lines (42 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
local log = require('java.utils.log')
local notify = require('java-core.utils.notify')
local function get_checkers()
local config = vim.g.nvim_java_config
local checks = {}
if config.verification.invalid_mason_registry then
table.insert(
checks,
select(1, require('java.startup.mason-registry-check'))
)
end
if config.verification.invalid_order then
table.insert(checks, select(1, require('java.startup.exec-order-check')))
end
if config.verification.duplicate_setup_calls then
table.insert(
checks,
select(1, require('java.startup.duplicate-setup-check'))
)
end
table.insert(checks, select(1, require('java.startup.nvim-dep')))
return checks
end
return function()
local checkers = get_checkers()
for _, check in ipairs(checkers) do
local check_res = check.is_valid()
if check_res.message then
if not check_res.success then
log.error(check_res.message)
notify.error(check_res.message)
else
log.warn(check_res.message)
notify.warn(check_res.message)
end
end
if not check_res.continue then
return false
end
end
return true
end