Skip to content

Conversation

@soifou
Copy link
Collaborator

@soifou soifou commented Nov 1, 2025

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:

@soifou soifou force-pushed the refactor/luasnip-source branch from 8539836 to 2ed5d8e Compare November 11, 2025 22:54
blink.cmp v1.0.0 has been release 8 months ago, this check can be
safely removed now.
Instead of displaying only `trigger`, first try to generate the
preview from the snippet's textNodes; if that's not available, fall
back to `docTrig` if it exists, or use the `trigger` as a last resort.
This setting, which prefers `docTrig` over the trigger, is confusing and
has seen little adoption despite its usefulness.

Users can still opt out in v1.0, but the option will be removed in v2.0
to simplify the codebase.
Update lua annotations using refactor branch
Fix `docTrig` replacement using Luasnip v2.4.1
Add initial support for choice nodes
@soifou soifou force-pushed the refactor/luasnip-source branch from 2ed5d8e to a280624 Compare November 11, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants