-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathlsp_setup.lua
More file actions
42 lines (30 loc) · 960 Bytes
/
lsp_setup.lua
File metadata and controls
42 lines (30 loc) · 960 Bytes
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
local path = require('java-core.utils.path')
local List = require('java-core.utils.list')
local Manager = require('pkgm.manager')
local server = require('java-core.ls.servers.jdtls')
local M = {}
---comment
---@param config java.Config
function M.setup(config)
local jdtls_plugins = List:new()
if config.java_test.enable then
jdtls_plugins:push('java-test')
end
if config.java_debug_adapter.enable then
jdtls_plugins:push('java-debug')
end
if config.spring_boot_tools.enable then
jdtls_plugins:push('spring-boot-tools')
local spring_boot_root = Manager:get_install_dir('spring-boot-tools', config.spring_boot_tools.version)
require('spring_boot').setup({
ls_path = path.join(spring_boot_root, 'extension', 'language-server'),
})
require('spring_boot').init_lsp_commands()
end
local default_config = server.get_config({
config = config,
plugins = jdtls_plugins,
})
vim.lsp.config('jdtls', default_config)
end
return M