Nvim: fixes to jdtls setup

Added runtimes and fixed lsp signature plugin
This commit is contained in:
Marko Korhonen 2023-09-05 10:22:09 +03:00
parent 09b1a3a47a
commit a6e95a4719
3 changed files with 26 additions and 3 deletions

View file

@ -23,6 +23,22 @@ require("jdtls").start_or_attach({
"-data", "-data",
workspace_dir, workspace_dir,
}, },
settings = { java = { signatureHelp = { enabled = true } } },
completion = { favoriteStaticMembers = { "java.text.MessageFormat.format" } },
runtimes = {
{
name = "JavaSE-1.8",
path = "/usr/lib/jvm/java-8-openjdk-amd64/",
},
{
name = "JavaSE-11",
path = "/usr/lib/jvm/java-11-openjdk-amd64/",
},
{
name = "JavaSE-19",
path = "/usr/lib/jvm/java-19-openjdk-amd64/",
},
},
}) })
require("plugins.mason").map_keys() require("plugins.mason").map_keys()

View file

@ -99,7 +99,14 @@ local plugins = {
{ "mfussenegger/nvim-dap", config = require("plugins.dap") }, { "mfussenegger/nvim-dap", config = require("plugins.dap") },
-- Display function signature -- Display function signature
"ray-x/lsp_signature.nvim", {
"ray-x/lsp_signature.nvim",
event = "VeryLazy",
opts = { always_trigger = true },
config = function(_, opts)
require("lsp_signature").setup(opts)
end,
},
-- Snippets plugin -- Snippets plugin
{ {

View file

@ -57,8 +57,7 @@ function m.setup()
end end
function m.map_keys() function m.map_keys()
local wk = require("which-key") require("which-key").register({
wk.register({
g = { g = {
name = "Go to", name = "Go to",
d = { vim.lsp.buf.definition, "Definition" }, d = { vim.lsp.buf.definition, "Definition" },
@ -79,6 +78,7 @@ function m.map_keys()
"List folders", "List folders",
}, },
}, },
k = { vim.lsp.buf.signature_help, "Signature help" },
D = { vim.lsp.buf.type_definition, "Type definition" }, D = { vim.lsp.buf.type_definition, "Type definition" },
rn = { vim.lsp.buf.rename, "Rename symbol" }, rn = { vim.lsp.buf.rename, "Rename symbol" },
ca = { vim.lsp.buf.code_action, "Code action" }, ca = { vim.lsp.buf.code_action, "Code action" },