21 lines
922 B
Fennel
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}
|