LuaSnip
LuaSnip copied to clipboard
Match multiple snippets
I am trying to convert all UltiSnips snippets to luasnip with exact same behavior (including duplicate triggers, embedded scripts ...).
To reproduce snippet menu (displayed with multiple matches) i need find all matching snippets, but there is only M.match_snippet exposed. I can't use choice node, because match function can be different for each snippet.
It would be nice to have function, which matches all snippets, or at least prio_iter function to implement my own.
Oh, we don't have that built-in, I think the most common solution for this is cmp_luasnip
This is just autocompletion, right? I want execute trigger and show all matched snippets. For example in actionscript (i don't write actionscript, it's juset first language in alphabetic order) for has 3 different snippets. UltiSnips in this case shows menu with choices. Theoretically i can replicate this behavior with choice node, but it will not work for snippets triggered using different match expression.
Ahh okay I understand
We don't have something like this yet, but it seems like a cool addition.
We could just extend the api for match_snippet to optionally return all matches (want to have the option to still abort on first match), and just pass all of them through vim.ui.select().