From 1cc6b8a2477a78249722f986e5a73d1c198a74fa Mon Sep 17 00:00:00 2001 From: fiplox Date: Thu, 26 Jan 2023 13:34:22 +0100 Subject: [PATCH] use jdtls format, format file --- ftplugin/java.lua | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/ftplugin/java.lua b/ftplugin/java.lua index 115ceaf..ca7fcdd 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -37,11 +37,15 @@ JAVA_DAP_ACTIVE = true local bundles = { 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 opt = { noremap = true, silent = true } @@ -150,32 +154,23 @@ local config = { -- for a list of options settings = { java = { - eclipse = { - downloadSources = true, - }, - configuration = { - updateBuildConfiguration = 'interactive', - }, - maven = { - downloadSources = true, - }, - implementationsCodeLens = { - enabled = true, - }, - referencesCodeLens = { - enabled = true, - }, - references = { - includeDecompiledSources = true, - }, + eclipse = { downloadSources = true }, + configuration = { updateBuildConfiguration = 'interactive' }, + maven = { downloadSources = true }, + implementationsCodeLens = { enabled = true }, + referencesCodeLens = { enabled = true }, + references = { includeDecompiledSources = true }, -- Set this to true to use jdtls as your formatter - format = { - enabled = false, - }, + format = { enabled = true }, + signatureHelp = { enabled = true }, }, - signatureHelp = { enabled = true }, + -- signatureHelp = { enabled = true }, completion = { 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.Matchers.*', 'org.hamcrest.CoreMatchers.*',