hrsh7th / vim-vsnip

Snippet plugin for vim/nvim that supports LSP/VSCode's snippet format.
MIT License
876 stars 37 forks source link

Completion menu does not show multiple snippets with same prefix #267

Open flotisable opened 1 year ago

flotisable commented 1 year ago

I'm using vim-mucomplete and have installed vim-vsnip-integ.

Recently, I'm trying multiple snippets with same prefix since there are different snippets for different codebase, but the complete menu only show the first one, as shown in the image(I have 2 snippets with prefix if)

圖片

There is issue(https://github.com/hrsh7th/vim-vsnip/issues/160) asking about the feature and it seems the feature is supported.

I have found there is has_key function call in the vsnip#get_complete_items function to skip the item with same prefix. If I comment out the checking, multiple snippets with same prefix can show up as expected, while I can not expand the snippet by just complete it.

圖片

Checking the git log shows the has_key function is added in commit https://github.com/hrsh7th/vim-vsnip/commit/70af9531f131b2f1e6674780dfe1e81893de02ab to fix the issue https://github.com/hrsh7th/vim-vsnip/issues/143

Is the support for multiple snippets with same prefix dropped intentionally or is it a bug and should be fixed? And is there way to expand the snippet by just complete it when there is multiple snippet with same prefix?