Saghen / blink.cmp

Performant, batteries-included completion plugin for Neovim
MIT License
640 stars 27 forks source link

Error when showing snippets' document with multi-line decriptions in friendly-snippets #91

Open ccbhj opened 6 hours ago

ccbhj commented 6 hours ago

Some errors show up when selecting snippets items from friendly-snippets: For example, 'break' in the shell file: image

error trace: Debug: ~/.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/init.lua:85 "failed to resolve item with error: ...m/lazy/blink.cmp/lua/blink/cmp/sources/snippets/init.lua:51: attempt to concatenate field 'description' (a table value)"

nvim version: v0.10.0 blink.cmp: commit https://github.com/Saghen/blink.cmp/commit/526f786a8658f99dff36013b4e31d1f7e6b0a56b

ccbhj commented 6 hours ago

After some investigation, I found the cause: when formating documentation of snippets, we treat the description field of a snippet item as string by default but it could a list of string sometimes(see snippets for shell in friendly-snippets ) image

So I suppose we can join the description if it is a list of string instead of string ?