use jdtls format, format file

This commit is contained in:
fiplox 2023-01-26 13:34:22 +01:00
parent 05819ed0c8
commit 1cc6b8a247
1 changed files with 19 additions and 24 deletions

View File

@ -37,11 +37,15 @@ JAVA_DAP_ACTIVE = true
local bundles = { local bundles = {
vim.fn.glob( vim.fn.glob(
home .. '/.local/share/nvim/mason/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar' home
.. '/.local/share/nvim/mason/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar'
), ),
} }
vim.list_extend(bundles, vim.split(vim.fn.glob(home .. '/.local/share/nvim/mason/packages/java-test/extension/server/*.jar'), '\n')) vim.list_extend(
bundles,
vim.split(vim.fn.glob(home .. '/.local/share/nvim/mason/packages/java-test/extension/server/*.jar'), '\n')
)
local function lsp_keymaps(bufnr) local function lsp_keymaps(bufnr)
local opt = { noremap = true, silent = true } local opt = { noremap = true, silent = true }
@ -150,32 +154,23 @@ local config = {
-- for a list of options -- for a list of options
settings = { settings = {
java = { java = {
eclipse = { eclipse = { downloadSources = true },
downloadSources = true, configuration = { updateBuildConfiguration = 'interactive' },
}, maven = { downloadSources = true },
configuration = { implementationsCodeLens = { enabled = true },
updateBuildConfiguration = 'interactive', referencesCodeLens = { enabled = true },
}, references = { includeDecompiledSources = true },
maven = {
downloadSources = true,
},
implementationsCodeLens = {
enabled = true,
},
referencesCodeLens = {
enabled = true,
},
references = {
includeDecompiledSources = true,
},
-- Set this to true to use jdtls as your formatter -- Set this to true to use jdtls as your formatter
format = { format = { enabled = true },
enabled = false,
},
},
signatureHelp = { enabled = true }, signatureHelp = { enabled = true },
},
-- signatureHelp = { enabled = true },
completion = { completion = {
favoriteStaticMembers = { favoriteStaticMembers = {
'org.assertj.core.api.Assertions.assertThat',
'org.assertj.core.api.Assertions.assertThatThrownBy',
'org.assertj.core.api.Assertions.assertThatExceptionOfType',
'org.assertj.core.api.Assertions.catchThrowable',
'org.hamcrest.MatcherAssert.assertThat', 'org.hamcrest.MatcherAssert.assertThat',
'org.hamcrest.Matchers.*', 'org.hamcrest.Matchers.*',
'org.hamcrest.CoreMatchers.*', 'org.hamcrest.CoreMatchers.*',