Closed sgoudham closed 1 year ago
You are responsible for setting the root_dir
appropriately. That's intentionally left up to the user to give more flexibility.
The find_root
function traverses upwards from the current buffer until it finds the markers. Make sure you run that on each buffer you open, not only once.
Ah okay that makes sense. Thanks for the speedy response!
Just one clarification: My config that I've listed above is run within the context of ftplugin/java.lua
, I was under the impression that the require("jdtls.setup").find_root(root_markers)
would get ran on each java buffer? Is that not the case there?
Ah nevermind, figured it out! Turns out I wasn't calling the function in the correct place. For any future travellers: https://github.com/sgoudham/dotfiles/blob/83924bfa130fb83da6c7066eb5a58bf2e7ef7bbc/dot_config/nvim/ftplugin/java.lua
Thanks so much again
LSP client configuration
Eclipse.jdt.ls version
1.10.0
Steps to Reproduce
projectA
and observe Java LSP startingcd
toprojectB
from within NeoVim (I am using project.nvim for convenience)single-file-mode
JdtRestart
projectA
workspace directory configured instead ofprojectB
Expected Result
When switching root directories from within neovim, I would expect the Java LSP to automatically detect and refresh the workspace directory to ensure that the correct workspace directory is passed to the LSP.
Actual Result
lsp.log
:lua require('jdtls').compile('full')