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

21 lines
946 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-08-23 09:41:00 +03:00
'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',
2022-02-24 18:08:59 +02:00
'-data', workspace_dir
}
})
2022-03-02 20:19:11 +02:00
require('plugins.lspconfig').lsp_map_keys('jdtls', nil)