Skip to content

bug: document_symbol only respecting spring-boot client #447

@soenkekrusche

Description

@soenkekrusche

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

  1. use devcontainer config, or add nvim-java as plugin to kickstart nvim
  2. open spring boot object (e.g. petclinic)
  3. open a controller
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions