LuaSnip icon indicating copy to clipboard operation
LuaSnip copied to clipboard

[Feature-Request] Show autotrigger snippets in completion

Open atticus-sullivan opened this issue 3 years ago • 3 comments

Hi, sometimes I forget about autotriggered snippets so it would be nice to be able to display autotriggered snippets in the completion menu of the completion engine as well by introducing a new option for that in the setup or maybe an explicit show option for the snippets function (contrary to the hide option).

atticus-sullivan avatar Aug 02 '22 09:08 atticus-sullivan

There's this PR (though it's outdated for current master) for showing autosnippets, I think the best way would be to set an option in cmp_luasnip.setup()

L3MON4D3 avatar Aug 04 '22 12:08 L3MON4D3

Ah of course. As this is only related to displaying, this should be done in the "adapters" to the completion engines. I'm gonna look into this (in a few weeks). But this changes look a bit complicated (at least at first sight) (have to dig through all the code related to caching first).

atticus-sullivan avatar Aug 04 '22 21:08 atticus-sullivan

Yeaaah, the caching makes the otherwise pretty straightforward job of turning a list of snippets into a list of completion-items a bit more messy :/ Luckily all items for one filetype are stored together, so it's not horribly complicated

L3MON4D3 avatar Aug 05 '22 14:08 L3MON4D3

Not sure since when but at least for my limited amount of autosnippets, I get them listed in the completion menu of cmp. Thus this issue is solved for me.

atticus-sullivan avatar May 18 '24 22:05 atticus-sullivan