nvim: Java formatting
This commit is contained in:
parent
6450791579
commit
12b53d3d53
2 changed files with 2 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
cache-dir (.. (vim.loop.os_homedir) :/.cache/jdtls)
|
||||
jars-dir (.. cache-dir :/jars)
|
||||
workspace-dir (.. cache-dir :/workspace/ project-name)
|
||||
formatter-config (.. cache-dir :/config/formatter. project-name :.xml)
|
||||
config {:cmd [:jdt-language-server :-data workspace-dir]
|
||||
:root_dir (vim.fs.dirname (. (vim.fs.find [:.gradlew
|
||||
:.git
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
(let [formatprg (vim.opt_local.formatprg:get)
|
||||
formatprg-exe (-> formatprg (vim.split " " {:trimempty true}) (. 1))]
|
||||
(if (= b.nifoc_formatter_disabled 1) nil
|
||||
(= b.nifoc_formatter_force_formatprg 1) (run-neoformat formatprg-exe)
|
||||
(= b.nifoc_lsp_formatter_enabled 1) (vim.lsp.buf.format {:timeout_ms 1000})
|
||||
(not= formatprg-exe nil) (run-neoformat formatprg-exe))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue