lspsaga.nvim icon indicating copy to clipboard operation
lspsaga.nvim copied to clipboard

error when symbol_in_winbar is used with an unsupported `kind`

Open fent opened this issue 1 year ago • 0 comments

Describe the bug

The propietary LSP I'm using is returning a kind value that is not in Lspsaga. The kind returned has a value of 0, not on this list: https://github.com/nvimdev/lspsaga.nvim/blob/a4d442896a9ff1f83ee3db965d81b659ebc977d5/lua/lspsaga/lspkind.lua

and so I'm getting the following error

Error detected while processing CursorMoved Autocommands for "<buffer=1>":
Error executing lua callback: ...-demo/plugins/lspsaga.nvim/lua/lspsaga/symbol/winbar.lua:99: attempt to index a nil value
stack traceback:
        ...-/plugins/lspsaga.nvim/lua/lspsaga/symbol/winbar.lua:99: in function 'insert_elements'
        ...-/plugins/lspsaga.nvim/lua/lspsaga/symbol/winbar.lua:128: in function 'find_in_node'
        ...-/plugins/lspsaga.nvim/lua/lspsaga/symbol/winbar.lua:153: in function 'render_symbol_winbar'
        ...-/plugins/lspsaga.nvim/lua/lspsaga/symbol/winbar.lua:249: in function <...-demo/plugins/lspsaga.nvim/lua/lspsaga/symbol/winbar.lua:245>

Steps to reproduce

It's hard since you'd have to get your LSP to return a kind not in https://github.com/nvimdev/lspsaga.nvim/blob/a4d442896a9ff1f83ee3db965d81b659ebc977d5/lua/lspsaga/lspkind.lua

Expected behavior

Show the items in winbar even without the icons, or have a default icon to show.

Neovim version (nvim -v)

v0.9.4

lspsaga commit

a4d4428

Terminal name/version

alacritty/0.13.1

fent avatar Apr 08 '24 04:04 fent