nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.48k stars 287 forks source link

Problems with jdt:// links from nvim-jdtls #1132

Closed mikehaertl closed 1 year ago

mikehaertl commented 1 year ago

Describe the bug

The new version 0.3 seems to bring back many problems with jdt://... links. For example when opening the finder on a method that is only available from a jar package I get this error:

Error executing vim.schedule lua callback: BufReadCmd Autokommandos für "jdt://*": Vim(lua):Error executing vim.schedule lua callback: .../mike/.local/share/nvim/plugged/nvim-jdtls/lua/jdtls.lua:1187: Vim:Error
executing vim.schedule lua callback: ...nvim/plugged/lspsaga.nvim/lua/lspsaga/implement/init.lua:147: Index out of bounds
stack traceback:
        [C]: in function 'nvim_buf_get_text'
        ...nvim/plugged/lspsaga.nvim/lua/lspsaga/implement/init.lua:147: in function 'parse_symbol'
        ...nvim/plugged/lspsaga.nvim/lua/lspsaga/implement/init.lua:170: in function 'render'
        ...nvim/plugged/lspsaga.nvim/lua/lspsaga/implement/init.lua:188: in function 'start'
        ...re/nvim/plugged/lspsaga.nvim/lua/lspsaga/symbol/init.lua:191: in function 'callback'
        ...re/nvim/plugged/lspsaga.nvim/lua/lspsaga/symbol/init.lua:91: in function 'handler'
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1394: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
        [C]: in function 'wait'
        .../mike/.local/share/nvim/plugged/nvim-jdtls/lua/jdtls.lua:1205: in function 'open_classfile'
        [string ":lua"]:1: in main chunk
        [C]: in function 'bufload'
        ...are/nvim/plugged/lspsaga.nvim/lua/lspsaga/definition.lua:205: in function 'handler'
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1394: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
stack traceback:
        [C]: in function 'nvim_buf_set_lines'
        .../mike/.local/share/nvim/plugged/nvim-jdtls/lua/jdtls.lua:1187: in function 'handler'
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1394: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
        [C]: in function 'wait'
        .../mike/.local/share/nvim/plugged/nvim-jdtls/lua/jdtls.lua:1205: in function 'open_classfile'
        [string ":lua"]:1: in main chunk
        [C]: in function 'bufload'
        ...are/nvim/plugged/lspsaga.nvim/lua/lspsaga/definition.lua:205: in function 'handler'
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1394: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
stack traceback:
        [C]: in function 'bufload'
        ...are/nvim/plugged/lspsaga.nvim/lua/lspsaga/definition.lua:205: in function 'handler'
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1394: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Steps to reproduce

What does not work, when on a method from an imported library method:

As usual the Java setup is not so easy, so I can not provide a simple procedure to reproduce.

I can help debugging it, though (i.e. provide LSP debug logs or add debug output if desired).

Expected behavior

It worked fine before the new 0.3.

Similar (fixed) issue: #851,

Neovim version (nvim -v)

0.9.0 commit 040f14598

lspsaga commit

44f2bea

Terminal name/version

Gnome Terminal 3.44.0

mikehaertl commented 1 year ago

:lua vim.lsp.buf.implemenation() works for me, no error. Same with :lua vim.lsp.buf.definition(): no error.

glepnir commented 1 year ago

finder also work

image

glepnir commented 1 year ago

but some bug need fix .

mikehaertl commented 1 year ago

Hmm, I first see the above error. When I enter <CR> the finder opens.

mikehaertl commented 1 year ago

Ok, the error is only when I first open the finder. The preview does not work then.

When I close and open the finder again, it seems to work.

glepnir commented 1 year ago

yep I reproduce this and fixing now.

glepnir commented 1 year ago

could you try it now ?

mikehaertl commented 1 year ago

I did a quick test and it looks good! No errors so far.

Thank you!

glepnir commented 1 year ago

Thanks for your patience in teaching me how to reproduce the problem

mikehaertl commented 1 year ago

No problem - but please keep your Java setup. Just to make sure ... 😄