1
0
Fork 0
dotfiles/home/config/nvim/ftplugin/java.fnl

15 lines
731 B
Text
Raw Normal View History

2022-11-27 16:12:49 +00:00
(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))