dotfiles/home/.config/nvim/ftplugin/java.lua

22 lines
977 B
Lua
Raw Normal View History

2022-02-24 18:08:59 +02:00
local nvim_local_dir = vim.fn.expand('~/.local/share/nvim')
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')
local workspace_dir = nvim_local_dir .. '/jdtls-workspaces/' .. project_name
2022-03-02 20:19:11 +02:00
2022-02-24 18:08:59 +02:00
require('jdtls').start_or_attach({
cmd = {
2022-09-15 14:54:23 +03:00
'/usr/lib/jvm/java-17-openjdk-amd64/bin/java', '-Declipse.application=org.eclipse.jdt.ls.core.id1',
2022-02-24 18:08:59 +02:00
'-Dosgi.bundles.defaultStartLevel=4',
'-Declipse.product=org.eclipse.jdt.ls.core.product',
'-Dlog.protocol=true', '-Dlog.level=ALL', '-Xms1g',
'--add-modules=ALL-SYSTEM', '--add-opens',
'java.base/java.util=ALL-UNNAMED', '--add-opens',
2022-03-02 20:19:11 +02:00
'java.base/java.lang=ALL-UNNAMED', '-jar', nvim_local_dir ..
2022-08-23 09:41:00 +03:00
'/mason/packages/jdtls/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar',
'-configuration',
nvim_local_dir .. '/mason/packages/jdtls/config_linux', '-data',
workspace_dir
2022-02-24 18:08:59 +02:00
}
})
2022-03-02 20:19:11 +02:00
2022-08-24 12:09:59 +03:00
require('plugins.lspconfig').map_keys()