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

16 lines
808 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)
2022-12-10 23:10:33 +00:00
formatter-config (.. cache-dir :/config/formatter. project-name :.xml)
2022-11-27 16:12:49 +00:00
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))