Closed devansh08 closed 1 year ago
Make sure jdtls.start_or_attach
is called on each buffer. That's why the readme/instructions tell you to put it into a java
ftplugin / FileType
autocmd.
Ah that worked. Did not realize this was the purpose of the ftplugin
. Thanks!
LSP client configuration
Eclipse.jdt.ls version
v1.24.0
Steps to Reproduce
After opening a maven project, the
jdtls
client gets attached to the first java file opened in a buffer (confirmed with:LspInfo
). The existing LSP and additional features (organize_imports()
) work well in that buffer.:LspInfo
output of first buffer:But on trying to open another java file in a second buffer, the client does not get attached to it. None of the LSP features work here. Everything still works fine in the first buffer, even on closing the buffer and reopening that first file again.
:LspInfo
output of second buffer:Note:
nvim-jdtls
is setup usinglazy.nvim
with these options:Expected Result
LSP features should work for any buffer created for a
.java
file.Actual Result
Any buffer/file opened after the first does not attach the
jdtls
client and LSP features do not work in it.Output of
lsp.log
for opening 2 buffers (first works perfectly, second doesnt work at all)::lua require('jdtls').compile('full')
- OutputsCompile successful
without any errors.