This repository has been archived on 2024-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
nvim-config/fnl/plugin/jdtls.fnl

21 lines
922 B
Fennel

;;; 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}