dotfiles/.config/nvim/ftplugin/java.lua

37 lines
861 B
Lua
Raw Normal View History

2022-10-18 23:03:39 +02:00
local caps = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
local mztenv = require "mzte_nv"
2022-10-21 14:31:08 +02:00
local bundle_info = mztenv.jdtls.getBundleInfo()
2022-10-18 23:03:39 +02:00
require("jdtls").start_or_attach {
cmd = {
"jdtls",
"-configuration",
vim.loop.os_homedir() .. "/.cache/jdtls/config",
"-data",
vim.loop.os_homedir() .. "/.cache/jdtls/workspace",
},
capabilities = caps,
2022-10-21 14:31:08 +02:00
root_dir = require("jdtls.setup").find_root {
".git",
"mvnw",
"gradlew",
"build.gradle",
},
2022-10-18 23:03:39 +02:00
settings = {
java = {
configuration = {
runtimes = mztenv.jdtls.findRuntimes(),
},
2022-10-21 14:31:08 +02:00
contentProvider = bundle_info.content_provider,
2022-10-18 23:03:39 +02:00
},
},
2022-10-21 14:31:08 +02:00
init_options = {
bundles = bundle_info.bundles,
},
2022-10-18 23:03:39 +02:00
}