blob: 31f9744d5d83ed38f3d9ffc54d8027a11b160d20 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
-- In Vimscript
-- augroup lsp
-- au!
-- au FileType java lua require('jdtls').start_or_attach({cmd = {'java-linux-ls'}})
-- augroup end
-- find_root looks for parent directories relative to the current buffer containing one of the given arguments.
-- require'lspconfig'.jdtls.setup {cmd = {'java-linux-ls'}}
if vim.fn.has("mac") == 1 then
JAVA_LS_EXECUTABLE = 'java-mac-ls'
elseif vim.fn.has("unix") == 1 then
JAVA_LS_EXECUTABLE = 'java-linux-ls'
else
print("Unsupported system")
end
require('jdtls').start_or_attach({
cmd = {JAVA_LS_EXECUTABLE},
root_dir = require('jdtls.setup').find_root({'gradle.build', 'pom.xml'})
})
|