Repository navigation
Description
Did you check docs and existing issues?
- I have read all the plugin docs
- I have searched the existing issues
- I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
0.11.5
Operating system/version
Win11/WSL Ubuntu 24.04
Describe the bug
Using current version of this plugin, it looks like document_symbol (via telescope, fzflua or just :lua vim.lsp.buf.document_symbol()) just returns values for the spring-boot client. For a minimal setup I've used the devcontainer init.lua available in this repo.
All symbols returned are just spring-boot annotations
Lazy (should be nvim-java 4.0.1?)
● nvim-java 21.46ms start
dir /home/soenke/.local/share/nvim/lazy/nvim-java
url https://github.com/nvim-java/nvim-java
branch main
commit 389ef7c
readme README.md
help |nvim-java.txt|
- jdk 21
- jdtls 1.54.0
When setting lsp loglevel to debug, this is the whole output i'm getting:
[DEBUG][2025-12-08 23:25:36] ...m/lsp/client.lua:674 "LSP[spring-boot]" "client.request" 1 "textDocument/documentSymbol" { textDocument = { uri = "<>.java" } } <function 1> 1
[DEBUG][2025-12-08 23:25:36] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 15, jsonrpc = "2.0", method = "textDocument/documentSymbol", params = { textDocument = { uri = "<>.java" } } }
[DEBUG][2025-12-08 23:25:36] .../vim/lsp/rpc.lua:391 "rpc.receive" { id = 15, jsonrpc = "2.0", result = { { kind = 11, location = { range = { ["end"] = { character = 15, line = 21 }, start = { character = 0, line = 21 } }, uri = "<>.java" }, name = "@+ '<>' (@RestController <: @Controller, @Component) <>Controller" }, { kind = 11, location = { range = { ["end"] = { character = 98, line = 37 }, start = { character = 1, line = 36 } }, uri = "<>.java" }, name = "@/** -- POST - Accept: application/<> - Content-Type: application/<>" }, { kind = 11, location = { range = { ["end"] = { character = 42, line = 38 }, start = { character = 30, line = 38 } }, uri = "<>.java" }, name = "@RequestBody" }, { kind = 11, location = { range = { ["end"] = { character = 87, line = 59 }, start = { character = 1, line = 59 } }, uri = "<>.java" }, name = "@/**/{request:.+} -- GET - Content-Type: application/<>" }, { kind = 11, location = { range = { ["end"] = { character = 53, line = 60 }, start = { character = 29, line = 60 } }, uri = "<>r.java" }, name = '@PathVariable("request")' } } }
Steps To Reproduce
- use devcontainer config, or add nvim-java as plugin to kickstart nvim
- open spring boot object (e.g. petclinic)
- open a controller
- run
:lua vim.lsp.buf.document_symbol()(or telescope/fzflua equivalent)
Expected Behavior
I'd expect seeing symbols returned by jdtls as well, instead of only spring boot annotations.
I looked for similar issues, and one of them suggested adding more documentSymbol types to jdtls. however, when using jdtls on it's own it returned the expected symbols just fine
I am not that familiar with nvim plugins, but if anyone has an idea where the problem lies or what needs to be done, I'd gladly try to work on a PR myself
Activity
logrusx commentedon Dec 9, 2025
This is something we had in the older version too. I'm not sure if it ever worked but I think it did at some point and somewhere along the way it changed. Is this something we're not instructing jdtls to do?
s1n7ax commentedon Dec 10, 2025
This did not work. I assume it's not supported by jdtls. But you can use these APIs.
https://github.com/nvim-java/nvim-java/wiki/Tips-&-Tricks#-workspace-symbols-search
soenkekrusche commentedon Dec 10, 2025
It is supported by jdtls, just the .devcontainer config to contain nvim-jdtls, having jdtls 1.54.0 on path an running
:lua vim.lsp.buf.document_symbol()returns the following:init.lua excerpt:
I'd like to keep using nvim-java, the integration with everything I need is awesome - thats the single thing I use often thats missing
s1n7ax commentedon Dec 10, 2025
I'll have a look
logrusx commentedon Dec 10, 2025
I can confirm it works on nvim-jdtls. Also adding the documentSymbol didn't fix it.
s1n7ax commentedon Dec 10, 2025
Can you create a new spring project
spring init -d web --extract proj/demoand then send me the document symbols you find withnvim-jdtlss1n7ax commentedon Dec 10, 2025
When I set this flag to false, document symbols are working but seems like spring-boot symbols are stops working. I don't see such flag in nvim-jdtls either.
https://github.com/nvim-java/nvim-java/blob/389ef7c938f89730f112054132d6a08c180733af/lua/java-core/ls/servers/jdtls/conf.lua?plain=1#L11C4-L11C32
soenkekrusche commentedon Dec 10, 2025
Document symbols:
src/main/java/com/example/proj/demo/DemoApplication.java|6 col 1-23| [Interface] @+ 'demoApplication' (@SpringBootApplication <: @SpringBootConfiguration, @Configuration, @Component) DemoApplicationWorkspace symbols with query
demo:src/test/java/com/example/proj/demo/DemoApplicationTests.java|7 col 7-27| [Class] DemoApplicationTests src/main/java/com/example/proj/demo/DemoApplication.java|7 col 14-29| [Class] DemoApplicationEdit: i'll try it out with your fix
Edit2: tyvm!