Closed zbaylin closed 1 month ago
After doing some more digging, it looks like this is a result of jdtls.setup
's find_root
returning a relative path (i.e. .
) in neovim 0.10.0 vs an absolute one in previous versions. Replacing
local root_dir = jdtls_setup.find_root({ "gradlew", "build.gradle", "settings.gradle" })
with
local root_dir = vim.fn.fnamemodify(jdtls_setup.find_root({ "gradlew", "build.gradle", "settings.gradle" }), ":p")
fixes the issue.
However I still think this is a bug, I can try to make a PR to fix it.
local root_dir = jdtls_setup.find_root({ "gradlew", "build.gradle", "settings.gradle" })
should be called within the FileType
event, otherwise it gets executed the time you open nvim/source the file, which could be too early.
This change here is probably responsible - although I'm a bit surprised this worked before for you:
My plan is actually to deprecate and remove the find_root
helper at some point in the future and refer to vim.fs.root
instead.
Reverted the change for now, but you should probably still update your configuration.
There's also a PR on neovim to adapt the vim.fs.root
behavior: https://github.com/neovim/neovim/pull/28964
LSP client configuration
jdtls.lua
:.jdtls.json
Eclipse.jdt.ls version
1.35.0
Steps to Reproduce
This occurs with any Java file I open. I'm primarily working with gradle.
Expected Result
The LSP server to start.
Actual Result
There is a runtime exception in JDTLS:
It appears this comes from
canonicalFilePathFromURI
, which I imagine is being passed in from neovim.