Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postfix snippets not shown or shown too late #47

Open
pogopaule opened this issue Jul 24, 2022 · 12 comments
Open

Postfix snippets not shown or shown too late #47

pogopaule opened this issue Jul 24, 2022 · 12 comments

Comments

@pogopaule
Copy link

pogopaule commented Jul 24, 2022

I created some postfix snippets.

I noticed that they always correctly expand, but they are either not shown in the completion list or are only shown if they fully written out. I have not yet been able to figure out when one or the other happens.

I don't have this problem with non-postfix snippets.

My config https://github.com/pogopaule/dotfiles/blob/master/nvim/lua/pogopaule/plugins/luasnip.lua

@saadparwaiz1
Copy link
Owner

Let me look into this :)

@pogopaule
Copy link
Author

pogopaule commented Jul 24, 2022

I managed to narrow down the probable cause. A postfix snippet not appearing in the list only happens when my tmux or nvim_lsp source is active. So either the tmux/lsp source itself is the problem or that fact that the tmux/lsp source provides many many completion entries.

But what is not explained by the tmux source is the fact that I need to write out the full postfix snippet name to make it appear as a suggestion. This seems to be a problem independent of the "tmux source problem". This problem disappears if luasnip is my only source.

Example: The snippet's name is .log

With only .lo this happens
image

With .log
image

Now I disable all sources expect for luasnip and .l is sufficient to make the snippet appear.
image

@L3MON4D3
Copy link
Contributor

Oh btw, are you using manual or auto-completion? It works for me with manual, but haven't tried auto

@pogopaule
Copy link
Author

pogopaule commented Jul 27, 2022

@L3MON4D3 What do you mean by auto-completion? I guess I use manual because I have to manually expand snippets and can't recall that I have configured something related to it.

And do you have a nvim_lsp source? Because the bug appears as soon as I activate it.

@L3MON4D3
Copy link
Contributor

What do you mean by auto-completion?

Oh, just whether it's always on or if you have to press some key to invoke nvim-cmp.

Yup, I have the nvim_lsp-source :/ Are they only not listed with that one, or does any other source do it?

@pogopaule
Copy link
Author

It is always on. The cmp list refreshes as I type.

I have these sources. If only luasnip, bufferand path are active --> no problem. If I activate tmux and/or nvim_lsp --> problem.

@L3MON4D3
Copy link
Contributor

Oh does the order of the sources make a difference?

@pogopaule
Copy link
Author

pogopaule commented Jul 28, 2022

No, that does not matter. I tried a couple of variations.

But what I have noticed again is that the list of suggestions is populated with the postfix snippets for a blink of an eye and then get overridden with the suggestions from other sources.

@L3MON4D3
Copy link
Contributor

Mhmm, I guess you'd have to take a look at cmp's issues and find similar ones, maybe see what kind of debugging-steps are taken (is there a quick way to check when the postfix-snippet is overridden?)
Maybe there is some heuristic in cmp to recognize specific items, and postfix-snippets trigger just that (starting with a dot..)

@hiberabyss
Copy link

May have something to do with keyword_pattern?

For me, postsnip completion worked for vim, while could not work for cpp.

@L3MON4D3
Copy link
Contributor

Maybe, but it sounds a bit more complicated then that (source and filetype affect postfix snippets showing up, while keyword pattern stays the same the entire time)

@fjchen7
Copy link

fjchen7 commented Dec 10, 2022

Hi, any workaround for this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants