mirror of
https://github.com/kossLAN/nvim-flake.git
synced 2025-11-04 17:59:50 -05:00
25 lines
489 B
Lua
25 lines
489 B
Lua
-- Exit if the language server isn't available
|
|
if vim.fn.executable('jdtls') ~= 1 then
|
|
return
|
|
end
|
|
|
|
local root_files = {
|
|
'.git',
|
|
'Main.java',
|
|
}
|
|
|
|
vim.lsp.start {
|
|
name = 'jdtls',
|
|
cmd = { 'jdtls' },
|
|
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
|
|
capabilities = require('user.lsp').make_client_capabilities(),
|
|
settings = {
|
|
java = {
|
|
format = {
|
|
enabled = true,
|
|
insertSpaces = true,
|
|
tabSize = 10,
|
|
},
|
|
},
|
|
},
|
|
}
|