Open michaelPotter opened 3 weeks ago
I had the same problem。
close lazy.nvim lazyload create ~/.config/nvim/ftplugin/java.lua Solved my problem
Thanks!
I already configure jdtls through ~/.config/nvim/ftplugin/java.lua
. I don't lazy load either.
Some other info after reading through #639 and #59 again...
Running this ...
:lua require("jdtls").open_classfile("jdt://contents/java.base/java.util/Arrays.class?=jdt.ls-java-project/%5C/usr%5C/lib%5C/jvm%5C/java-17-openjdk%5C/lib%5C/jrt-fs.jar%60java.base=/javadoc_location=/https:%5C/%5C/docs.oracle.com%5C/en%5C/java%5C/javase%5C/17%5C/docs%5C/api%5C/=/%3Cjava.util(Arrays.class")
... DOES populate the (current, already open) buffer with both commits 1069131 and ad5ab1c (had the wrong commit here earlier but I double checked ad5ab1c).
Also ...
:verbose autocmd BufReadCmd jdt://*
--- Autocommands ---
BufReadCmd
jdt://* lua require('jdtls').open_classfile(vim.fn.expand('<amatch>'))
Last set from ~/.local/share/nvim/lazy/nvim-jdtls/plugin/nvim_jdtls.vim line 6
Did a little digging... Seems like jdtls.setup.attach_to_active_buf()
might not be doing the right thing? Assuming the goal is to find an active jdtls client instance from other buffers and start_or_attach
should use that to short-circuit before the code added in ad5ab1c ?
I get this message using both commits... Seems to come from the bottom of attach_to_active_buf.
No active LSP client found to use for jdt:// document
In case it is relevant I have ...
$ nvim --version
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202
LSP client configuration
Eclipse.jdt.ls version
No response
Steps to Reproduce
(This seems to be a regression in commit ad5ab1c? It seems to work okay on commit 1069131 or earlier.)
First checkout commit ad5ab1c or later.
Call
vim.lsp.buf.definition
on a class, egExpected Result
The class definition is opened.
Actual Result
An empty buffer loads and I get the following error:
fwiw, in both commits where it does/doesn't work,
set buftype?
returnsbuftype=nofile
for the jdt:// bufferThanks!