You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've recently switched from nvim-jdtls to nvim-java (and from Telescope to FzfLua for better presentation) and for some reason LSP document symbols just does not work, FzfLua says [Fzf-lua] LSP: server does not support textDocument/documentSymbol. It did work with nvim-jdtls. Workspace symbols do work correctly, but I had to disable spring-boot-tools because this plugin's output is clearly meant to be used with some other tool and not FzfLua. Document symbols also work for other languages, for example Lua. Everything else I've tried so far (completions, debugging, running JUnits etc.) also works, just not document symbols. It's not a very big deal, but would be helpful when working in codebases with Java files going into thousands of lines.
I've tried some print debugging and found that :lua print(vim.lsp.get_clients({name="jdtls"})[1]:supports_method("textDocument/documentSymbol", 3)) prints false, but if I try :lua vim.print(vim.lsp.get_clients({name="jdtls"})[1]) it gives me this, which does not make sense for me:
Unfortunately that's not it. I did an experiment, took nvim-java/starter-lazyvim starter config, disabled spring_boot_tools as it does provide document symbols, run Neovim with this config by substituting XDG_CONFIG_DIR. Then I pointed Neovim at a random class with main method and vim.lsp.buf.document_symbol() still says that method is not supported. JDTLS is attached.
I will try debugging it further on a different machine, from scratch. And maybe I'll check different versions of Neovim, plugins or JDTLS.
No worries, I'm not expecting you to find the cause. I'll debug this myself and let you know when I find anything. I'm assuming the problem is somewhere in my config or environment.
I'm at home now and have the time just to test if it works for me. It does. Both running :lua vim.lsp.buf.document_symbol() and :FzfLua lsp_document_symbols shows some symbols for me. Unfortunately I'm not that familiar with Neovim and LSP yet and cannot tell if those are the right symbols. Maybe I need to spawn an Eclipse IDE and see if they match, but can't do that right now.
Try the Kickstart starter, I think I used it recently. At least I'm sure it setup the language servers fine. Also my configuration is based on Kickstart, though not the nvim-java's kickstart starter. Nevertheless it follows the same conventions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi, I've recently switched from
nvim-jdtlstonvim-java(and from Telescope to FzfLua for better presentation) and for some reason LSP document symbols just does not work, FzfLua says[Fzf-lua] LSP: server does not support textDocument/documentSymbol. It did work withnvim-jdtls. Workspace symbols do work correctly, but I had to disablespring-boot-toolsbecause this plugin's output is clearly meant to be used with some other tool and not FzfLua. Document symbols also work for other languages, for example Lua. Everything else I've tried so far (completions, debugging, running JUnits etc.) also works, just not document symbols. It's not a very big deal, but would be helpful when working in codebases with Java files going into thousands of lines.I've tried some print debugging and found that
:lua print(vim.lsp.get_clients({name="jdtls"})[1]:supports_method("textDocument/documentSymbol", 3))printsfalse, but if I try:lua vim.print(vim.lsp.get_clients({name="jdtls"})[1])it gives me this, which does not make sense for me:My setup, some paths redacted. Neovim is installed via AppImage:
OS default Java:
My lspconfig loaded with lazy.nvim, written from scratch from various guides, not a distribution:
Output of
:LspInfoon any random Java code after everything is loaded and built:And
ftplugin/java.lua:All reactions