forked from nvim-java/nvim-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnvim-dep.lua
More file actions
61 lines (53 loc) · 1.54 KB
/
nvim-dep.lua
File metadata and controls
61 lines (53 loc) · 1.54 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
local notify = require('java-core.utils.notify')
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.check()
log.info('check neovim plugin dependencies')
M.neovim_plugin_check()
end
---@private
function M.neovim_plugin_check()
for _, pkg in ipairs(pkgs) do
local ok, _ = pcall(require, pkg.name)
if not ok then
if pkg.warn then
log.warn(pkg.warn)
notify.warn(pkg.warn)
else
log.error(pkg.err)
error(pkg.err)
end
end
end
end
return M