Invalid buffer id: 1 when doing an incoming/outgoing calls
Doing a lua vim.lsp.buf.outgoing_calls() (or a lua vim.lsp.buf.incoming_calls()) cause the error below to be shown. After pressing Enter the call hierarchy shows in panel/popout as expected.
Error executing vim.schedule lua callback: ...tart/litee-calltree.nvim/lua/litee/calltree/handlers.lua:148: Invalid buffer id: 1
stack traceback:
[C]: in function 'nvim_create_autocmd'
...tart/litee-calltree.nvim/lua/litee/calltree/handlers.lua:148: in function 'handler'
/usr/share/nvim/runtime/lua/vim/lsp.lua:1025: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
:version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
The above error would indicate you unloaded the buffer in which you initially invoked the calltree.
The handler will grab the current buffer when the lsp call is made and then assign an auto command (event handler) to it.
When you experience this can you do a ": ls!" And see that state of the buffer which matches the buffer id in the error?
Hi,
That buffer id does not exist (it's always =1 it seems) in the list produced by : ls!:
:ls!
2u h "[Scratch]" line 0
3u h- "Calltree Help" line 0
4u h- "Filetree Help" line 0
5u h- "Bookmarks Help" line 0
...
..
Basically what I do is just put the cursor in side a method (Java/JDTLS) and perform the command:
: lua vim.lsp.buf.incoming_calls()
which then generate the error and after I pressed <Enter> the panel is displayed and working as expected (i.e. displaying the expected incoming/outgoing calls).
I only managed to get this to work at all for Java currently. E.g. for TS I get:
method textDocument/prepareCallHierarchy is not supported by any of the servers registered for the current buffer
but I try to get that fixed so that I can try with another LSP-server.
Odd, can you see if this happens with another LSP, wonder if it's specific to java
I have the same issue (golang code).
can you both check if the latest push fixed this?
Yup works for me again now 👍