Skip to content

Commit 7cc6806

Browse files
committed
update configs
- jdtls - disable illuminate on large files
1 parent 8a56c4b commit 7cc6806

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

bin/java-lsp

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fi
3535
# 1. https://github.com/mfussenegger/nvim-jdtls#configuration
3636
# 2. https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line
3737
# shellcheck disable=SC2086
38-
$JAVA_PRG $_DEBUG_OPTS $_LOMBOK_OPT \
38+
exec $JAVA_PRG $_DEBUG_OPTS $_LOMBOK_OPT \
3939
-Declipse.application=org.eclipse.jdt.ls.core.id1 \
4040
-Dosgi.bundles.defaultStartLevel=4 \
4141
-Declipse.product=org.eclipse.jdt.ls.core.product \
@@ -50,5 +50,3 @@ $JAVA_PRG $_DEBUG_OPTS $_LOMBOK_OPT \
5050
--add-modules=ALL-SYSTEM \
5151
--add-opens java.base/java.util=ALL-UNNAMED \
5252
--add-opens java.base/java.lang=ALL-UNNAMED
53-
54-
popd

lua/aceforeverd/lsp/jdtls.lua

+21-11
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ function M.jdtls()
3131
local root_marks = { 'mvnw', 'gradlew', 'pom.xml', '.git' }
3232
local prj_root = require('jdtls.setup').find_root(root_marks)
3333

34-
local extendedClientCapabilities = jdtls.extendedClientCapabilities;
35-
extendedClientCapabilities.resolveAdditionalTextEditsSupport = true;
34+
local extendedClientCapabilities = jdtls.extendedClientCapabilities
35+
extendedClientCapabilities.resolveAdditionalTextEditsSupport = true
3636

37-
-- TODO: check java version is jdk 11 or later
37+
-- TODO: check java version, jdtls requires JAVA >= 17
3838

3939
local cfg_file
4040
if vim.fn.has('mac') == 1 then
@@ -56,19 +56,29 @@ function M.jdtls()
5656
local config = vim.tbl_deep_extend('force', {
5757
cmd = { config_path .. '/bin/java-lsp', dir, dir .. '/' .. cfg_file, workspace_dir },
5858
settings = {
59-
-- https://github.com/mfussenegger/dotfiles/blob/833d634251ebf3bf7e9899ed06ac710735d392da/vim/.config/nvim/ftplugin/java.lua#L1-L149
59+
-- https://github.com/mfussenegger/dotfiles/blob/master/vim/.config/nvim/ftplugin/java.lua
6060
java = {
61+
autobuild = { enabled = false },
62+
maxConcurrentBuilds = 8,
6163
signatureHelp = { enabled = true },
6264
contentProvider = { preferred = 'fernflower' },
65+
saveActions = {
66+
organizeImports = true,
67+
},
6368
completion = {
6469
favoriteStaticMembers = {
65-
'org.hamcrest.MatcherAssert.assertThat',
66-
'org.hamcrest.Matchers.*',
67-
'org.hamcrest.CoreMatchers.*',
68-
'org.junit.jupiter.api.Assertions.*',
69-
'java.util.Objects.requireNonNull',
70-
'java.util.Objects.requireNonNullElse',
71-
'org.mockito.Mockito.*',
70+
"io.crate.testing.Asserts.assertThat",
71+
"org.assertj.core.api.Assertions.assertThat",
72+
"org.assertj.core.api.Assertions.assertThatThrownBy",
73+
"org.assertj.core.api.Assertions.assertThatExceptionOfType",
74+
"org.assertj.core.api.Assertions.catchThrowable",
75+
"org.hamcrest.MatcherAssert.assertThat",
76+
"org.hamcrest.Matchers.*",
77+
"org.hamcrest.CoreMatchers.*",
78+
"org.junit.jupiter.api.Assertions.*",
79+
"java.util.Objects.requireNonNull",
80+
"java.util.Objects.requireNonNullElse",
81+
"org.mockito.Mockito.*",
7282
},
7383
filteredTypes = {
7484
'com.sun.*',

lua/aceforeverd/plugins/init.lua

+2
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ M.plugin_list = {
248248
'regex',
249249
},
250250
delay = vim.go.updatetime,
251+
-- nvim hang if file too large, disable on large file
252+
large_file_cutoff = 10000, -- lines
251253
})
252254

253255
vim.keymap.set('n', '<a-i>', function()

0 commit comments

Comments
 (0)