blink.cmp icon indicating copy to clipboard operation
blink.cmp copied to clipboard

refactor(snippet): rework luasnip source

Open soifou opened this issue 1 month ago • 0 comments

Some refactoring on this source for easier maintenance with better annotations.

A potential fix for #1081. Possibly a race condition causing duplicated snippets due to premature cache initialization. I haven't been able to reproduce it myself, so if anyone wants to test it out, that'd be great!

The insertText is "improved" to be more like other snippet engines or LSPs. For example, for a while~ snippet, it shows whi|le true do instead of the actual whi|le, with support of multi-line snippets, etc., (fallback to the label/trigger). I think it'd align better with what we observe elsewhere.

Deprecation of opts.prefer_doc_trig (default true, to be removed in v2) since it has proven very useful and reliable over the months since its introduction.

TODO:

  • Show blink.cmp completion window for choices as for now we don't have any.
  • Update annotations when https://github.com/L3MON4D3/LuaSnip/pull/1396 will be merged.

soifou avatar Nov 01 '25 22:11 soifou