-
-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(java)!: move to nvim-java
for jdtls
setup
#1095
Conversation
Review ChecklistDoes this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist: Proper conventional commit scoping:
|
nvim-java
for jdtls
setupnvim-java
for jdtls
setup
I work with the java pack on a daily basis. Can I test this out first? |
Please do |
I was able to solve the lombok issue by doing full reset on nvim and also deleting my ~/.m2 folder. I couldn't get debugging to work because of this upstream issue: nvim-java/nvim-java#125. I tried disabling spring-boot-tools via config, but it does not work: return {
{ import = "astrocommunity.pack.java" },
{
"AstroNvim/astrolsp",
opts = {
config = {
jdtls = {
settings = {
java = {
configuration = {
java_debug_adapter = {
enable = true,
},
spring_boot_tools = {
enable = false,
},
jdk = {
auto_install = false,
},
runtimes = {
{
name = "JavaSE-21",
path = os.getenv "HOME" .. "/.sdkman/candidates/java/21.0.1-tem",
},
},
},
},
},
},
},
},
},
} |
I don't think nvim-java is mature enough yet to replace nvim-jdtls. |
@Juniar-Rakhman the options for disabling spring boot are not part of jdtls. They should be passed to the |
I think if we do that, we might as well just make a plugin for I do think configuring spring boot directly rather than using |
https://github.com/JavaHello/spring-boot.nvim I don't even know if it needs to be a pack, it can just be a plugin in the |
thanks! the following config works for me: return {
{ import = "astrocommunity.pack.java" },
{
"nvim-java/nvim-java",
opts = {
jdk = {
auto_install = false,
},
spring_boot_tools = {
enable = false,
},
},
},
{
"AstroNvim/astrolsp",
opts = {
config = {
jdtls = {
settings = {
java = {
configuration = {
runtimes = {
{
name = "JavaSE-21",
path = os.getenv "HOME" .. "/.sdkman/candidates/java/21.0.1-tem",
},
},
},
},
},
},
},
},
},
}
Debugging works on test files at least, further testing is needed. You need to turn off the |
@mehalter I did some further testing. Debugging and testing works, but not as intuitive as nvim-jdtls. Nvim-jdtls functionalities that I often use, such as generating tests, go to tests, attaching debugger to a running process are still missing. Debugging experience is not very nice, when running test in debug mode, the dap-ui does not open automatically. So in conclusion I would rather stick with nvim-jdtls, maybe we could upgrade the current java pack and integrate nvim-jdtls with spring-boot.nvim. I know that nvim-java is much easier to config, but I think the current java pack is good enough in hiding the complexity of nvim-jdtls. I don't think moving the pack to nvim-java is worth the missing functionalities and the regression in user experience. |
Thanks for taking the time to test this PR @Juniar-Rakhman. This is exactly what the community near more off! 🫶🏽 |
Closes #1062
Closes #1064
📑 Description
This moves the Java pack to use
nvim-java
which greatly decreases the complexity of the pack as well as adds stuff like spring-boot support out of the box.I did some testing and it spins up totally fine, the only downside I have found so far is that the debugger in my testing doesn't seem to get configured correctly. A debugging adapter is created but no DAP configurations are inserted. There seems to be an upstream issue regarding this: nvim-java/nvim-java#169
Someone might want to run this down or verify if it's a me problem before we merge this in.
TODO