-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathnvim-dep.lua
More file actions
67 lines (58 loc) · 1.56 KB
/
nvim-dep.lua
File metadata and controls
67 lines (58 loc) · 1.56 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
local log = require('java.utils.log')
local pkgs = {
{
name = 'mason-registry',
err = [[mason.nvim is not installed. nvim-java requires mason.nvim to install dependecies.
Please follow the install guide in https://github.com/nvim-java/nvim-java to install nvim-java]],
},
{
name = 'dap',
err = [[nvim-dap is not installed. nvim-java requires nvim-dap to setup the debugger.
Please follow the install guide in https://github.com/nvim-java/nvim-java to install nvim-java]],
},
{
name = 'lspconfig',
err = [[nvim-lspconfig is not installed. nvim-lspconfig requires nvim-lspconfig to show diagnostics & auto completion.
Please follow the install guide in https://github.com/nvim-java/nvim-java to install nvim-java]],
},
{
name = 'java-refactor',
warn = [[nvim-java-refactor is not installed. nvim-java-refactor requires nvim-java to do code refactoring
Please add nvim-java-refactor to the current dependency list
{
"nvim-java/nvim-java",
dependencies = {
"nvim-java/nvim-java-refactor",
....
}
}
Please follow the install guide in https://github.com/nvim-java/nvim-java to install nvim-java]],
},
}
local M = {}
function M.is_valid()
log.info('check neovim plugin dependencies')
for _, pkg in ipairs(pkgs) do
local ok, _ = pcall(require, pkg.name)
if not ok then
if pkg.warn then
return {
success = false,
continue = true,
message = pkg.warn,
}
else
return {
success = false,
continue = false,
message = pkg.err,
}
end
end
end
return {
success = true,
continue = true,
}
end
return M