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
NCM has no control over the priority where there's name collision of snippets
The point where ncm removes the injected snippet is not elegant, yet, I haven't seen the use case where this approach fails.
Here's my proposal:
Things would be a lot easier if a common convension is set up so that snippet engines recognize the v:completed_item.snippet and v:completed_item.snippet_trigger.
Other auto-completion plugins may integrate with snippet engine more easily.
And there's no need to cleanup the snippet after completion.
The snippet_trigger is useful, for example, in ncm, the popup menu looks like this when there's a file named datetime.noww. A more complicated situation would be non-parameter-expansion snippets.
from datetime import datetime
now = datetime.now
| now [+] now(cls, tz=None) |
|datetime.noww [ ] ~buf |
Notice that the now method is left-padded with datetime. to be merged with the items from filepath completion. Without snippet_trigger, the engine may not be able to know it should replace now instead of datetime.now.
This is also related to neovim/neovim#7179, since vim doesn't forward custom field name like snippet and snippet_trigger. Currently ncm also uses some dirty hack to get this to work.
The text was updated successfully, but these errors were encountered:
This is something I've wanted to do for a long time actually. I think using a pop up completion menu would be a lot simpler than the current multisnip method, and it'd remove the tlib dependency. I've just been struggling finding time for SnipMate as I started a new job not too long ago. Hopefully I can find some time this Labor Day at the latest.
Hi, I'm the author of nvim-completion-manager (NCM)
Currently NCM uses snipmate for function parameter expansion, and snippets expansions from language server
My current approach is quite hacky
In short, NCM injects the snippet into snipmate. And it remembers to cleanup the injected snippet afterwards.
As discussed in Shougo/neosnippet.vim#398 (comment)
This approach has some disavantages.
The point where ncm removes the injected snippet is not elegant, yet, I haven't seen the use case where this approach fails.Here's my proposal:
Things would be a lot easier if a common convension is set up so that snippet engines recognize the
v:completed_item.snippet
andv:completed_item.snippet_trigger
.The
snippet_trigger
is useful, for example, in ncm, the popup menu looks like this when there's a file nameddatetime.noww
. A more complicated situation would be non-parameter-expansion snippets.The completion items are
Notice that the
now
method is left-padded withdatetime.
to be merged with the items from filepath completion. Withoutsnippet_trigger
, the engine may not be able to know it should replacenow
instead ofdatetime.now
.This is also related to neovim/neovim#7179, since vim doesn't forward custom field name like
snippet
andsnippet_trigger
. Currently ncm also uses some dirty hack to get this to work.The text was updated successfully, but these errors were encountered: