15 lines
731 B
Text
15 lines
731 B
Text
|
(let [jdtls (require :jdtls)
|
||
|
project-name (vim.fn.fnamemodify (vim.fn.getcwd) ":p:h:t")
|
||
|
cache-dir (.. (vim.loop.os_homedir) :/.cache/jdtls)
|
||
|
jars-dir (.. cache-dir :/jars)
|
||
|
workspace-dir (.. cache-dir :/workspace/ project-name)
|
||
|
config {:cmd [:jdt-language-server :-data workspace-dir]
|
||
|
:root_dir (vim.fs.dirname (. (vim.fs.find [:.gradlew
|
||
|
:.git
|
||
|
:.mvnw]
|
||
|
{:upward true})
|
||
|
1))}]
|
||
|
(set vim.env.JAVA_OPTS (.. "-javaagent:" jars-dir :/lombok.jar))
|
||
|
(jdtls.start_or_attach config))
|
||
|
|