Rewrite the remaining neovim config in lua

This commit is contained in:
2025-01-10 18:56:19 +01:00
parent 889af814fc
commit 96b0313c36
6 changed files with 256 additions and 237 deletions

View File

@ -23,59 +23,59 @@ end
-- See `:help vim.lsp.start_client` for an overview of the supported `config` options.
local config = {
on_attach = on_attach, -- We pass our on_attach keybindings to the configuration map
flags = {
debounce_text_changes = 150,
},
on_attach = on_attach, -- We pass our on_attach keybindings to the configuration map
flags = {
debounce_text_changes = 150,
},
-- The command that starts the language server
-- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line
cmd = {
'java',
-- The command that starts the language server
-- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line
cmd = {
'java',
'-Declipse.application=org.eclipse.jdt.ls.core.id1',
'-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', 'java.base/java.lang=ALL-UNNAMED',
'-Declipse.application=org.eclipse.jdt.ls.core.id1',
'-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', 'java.base/java.lang=ALL-UNNAMED',
'-jar', jdtls_home .. '/plugins/org.eclipse.equinox.launcher_1.6.900.v20240613-2009.jar',
'-configuration', jdtls_home .. '/config_linux',
'-data', os.getenv('HOME') .. '/.cache/jdtls/' .. project_name
},
'-jar', jdtls_home .. '/plugins/org.eclipse.equinox.launcher_1.6.900.v20240613-2009.jar',
'-configuration', jdtls_home .. '/config_linux',
'-data', os.getenv('HOME') .. '/.cache/jdtls/' .. project_name
},
-- This is the default if not provided, you can remove it. Or adjust as needed.
-- One dedicated LSP server & client will be started per unique root_dir
root_dir = vim.fs.root(0, {'.git', 'mvnw', 'gradlew', 'build.gradle'}),
-- This is the default if not provided, you can remove it. Or adjust as needed.
-- One dedicated LSP server & client will be started per unique root_dir
root_dir = vim.fs.root(0, {'.git', 'mvnw', 'gradlew', 'build.gradle'}),
-- Here you can configure eclipse.jdt.ls specific settings
-- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
-- for a list of options
settings = {
java = {
signatureHelp = { enabled = true },
jdt = {
ls = {
androidSupport = { enabled = true },
}
}
}
},
-- Here you can configure eclipse.jdt.ls specific settings
-- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
-- for a list of options
settings = {
java = {
signatureHelp = { enabled = true },
jdt = {
ls = {
androidSupport = { enabled = true },
}
}
}
},
-- Language server `initializationOptions`
-- You need to extend the `bundles` with paths to jar files
-- if you want to use additional eclipse.jdt.ls plugins.
--
-- See https://github.com/mfussenegger/nvim-jdtls#java-debug-installation
--
-- If you don't plan on using the debugger or other eclipse.jdt.ls plugins you can remove this
init_options = {
bundles = {}
},
-- Language server `initializationOptions`
-- You need to extend the `bundles` with paths to jar files
-- if you want to use additional eclipse.jdt.ls plugins.
--
-- See https://github.com/mfussenegger/nvim-jdtls#java-debug-installation
--
-- If you don't plan on using the debugger or other eclipse.jdt.ls plugins you can remove this
init_options = {
bundles = {}
}
}
-- This starts a new client & server,
-- or attaches to an existing client & server depending on the `root_dir`.