nvimdev / nvimdev/lspsaga.nvim
error when symbol_in_winbar is used with an unsupported `kind`
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 3.8k
- Forks
- 308
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lua/lspsaga/symbol/winbar.lua at the reported line 99 and compare its kind lookup with lua/lspsaga/lspkind.lua. Reproduce or inspect handling for an unsupported kind such as 0. Done means symbol winbar rendering no longer errors and items remain visible without an icon or use a default icon.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100