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
40 lines (34 loc) · 1.02 KB
/
nvim-dep.lua
File metadata and controls
40 lines (34 loc) · 1.02 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
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]],
},
}
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
log.error(pkg.err)
error(pkg.err)
end
end
end
return M