You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: extract word from completion item for auto-insert preview (#341)
* feat: extract word from completion item for auto-insert preview
Use a modified version of nvim-cmp's word extraction algorithm from
expanded snippets for use in auto-insert preview textEdits.
For example, if a snippet expansion results in something like:
```
my_neat_function(int arg1, double arg2)
```
Then the floating window will show the above for that completion, but
when selecting it, the buffer will only insert `my_neat_function`. This
allows using the snippet completion item without actually _accepting_ it
by just selecting it in the preview window and then continuing to type.
So one could type "my_n", Ctrl-N/Tab (or whatever your keymap is) to
select `my_neat_function`, and then just continue with typing the ( and
args manually. Of course, accepting the completion will still work as
expected by expanding the snippet.
* refactor: word extraction for auto-insert preview
---------
Co-authored-by: Liam Dyer <[email protected]>
0 commit comments