quangnguyen30192 / cmp-nvim-ultisnips

nvim-cmp source for ultisnips
Apache License 2.0
145 stars 19 forks source link

Taking into account the user's current text, for auto completion #18

Closed ColinKennedy closed 2 years ago

ColinKennedy commented 2 years ago

Over at nvim-cmp, I filed an issue while trying snippet autocompletion out - https://github.com/hrsh7th/nvim-cmp/issues/451

The issue is that auto-completion results showed all snippets, regardless of what was currently typed. I made a fork which implements that check, over here: https://github.com/ColinKennedy/cmp-nvim-ultisnips/tree/add_snippet_recognition

I haven't done performance metrics to see if there's a big hit but I haven't noticed any slow down with completion results. Would you be interested in adding this in a PR?

quangnguyen30192 commented 2 years ago

Hey @ColinKennedy, thanks for the PR, the issue is interesting. It would be awesome if you could raise a PR in my repo?

quangnguyen30192 commented 2 years ago

@ColinKennedy: Sorry for the slow response

smjonas commented 2 years ago

@ColinKennedy I really like this approach! I have recently implemented a parser for snippet headers that allows us to retrieve more info about snippets than just the tab trigger and file path.

I think we should combine these approaches such that only the available snippets are shown. We could also make this configurable by users so they can decide whether only those snippets marked available by UltiSnips are provided or also the ones retrieved by the parser (that also includes regex snippets).