feat: added java support I think

This commit is contained in:
alzalia1 2025-08-17 11:58:53 +02:00
parent 27d1234f6b
commit 7a0e05991d
4 changed files with 32 additions and 0 deletions

View file

@ -7,6 +7,7 @@ local servers = {
clangd = {},
ts_ls = {},
dartls = {},
jdtls = {},
}
for name, opts in pairs(servers) do

View file

@ -0,0 +1,19 @@
return {
"simaxme/java.nvim",
config = function()
require("java").setup {
rename = {
enable = true, -- enable the functionality for renaming java files
nvimtree = true, -- enable nvimtree integration
write_and_close = false, -- automatically write and close modified (previously unopened) files after refactoring a java file
},
snippets = {
enable = true, -- enable the functionality for java snippets
},
root_markers = { -- markers for detecting the package path (the package path should start *after* the marker)
"main/java/",
"test/java/",
},
}
end,
}

View file

@ -0,0 +1,10 @@
return {
"mfussenegger/nvim-jdtls",
config = function()
local config = {
cmd = { "/usr/bin/jdtls" },
root_dir = vim.fs.dirname(vim.fs.find({ "gradlew", ".git", "mvnw" }, { upward = true })[1]),
}
require("jdtls").start_or_attach(config)
end,
}