;;; jdtls.fnl - nvim-jdtls configuration
(import-macros {: hook! : module-call! : module-fn!} :macros)
(fn configure []
(hook! :FileType :java
#(let [root-dir (module-call! :jdtls.setup :find_root
[ ".git" "mvnw" "gradlew" "build.gradle" ])
lsp-cap (module-call! :cmp_nvim_lsp :default_capabilities)]
(module-call! :jdtls :start_or_attach
{ :capabilities lsp-cap
:on_attach (module-fn! :plugin.lsp :on-attach)
:root_dir root-dir
:cmd [ "jdtls"
"-data"
(module-call! :plugin.lsp
:get-data-dir
:jdtls root-dir) ]}))))
{: configure}