Open kkharji opened 4 years ago
My Neovim setup allows me to easily switch between LSC and Neovim LSP + completion.nvim.
Both setups do roughly the same thing, auto-complete via language servers.
In my tests, Neovim LSP + completion.nvim popup rendering is exactly the same as LSC. I suspect both are populating and using Vim's completion popup.
A recent post over on Reddit discussed this issue, especially with comparison to COC.
If I was speculate, I suspect COC is using a floating window for completions maybe with asynchronous population (I don't know this, just a hunch).
I don't believe completion.nvim is doing anything substantially incorrect, other auto-completion plugins, apart from COC, behave very similarly.
It just may be a limitation of Vim's completion popup system.
@tami5 Your reproduce steps are very fuzzy.
If I was speculate, I suspect COC is using a floating window for completions maybe with asynchronous population (I don't know this, just a hunch). I don't believe completion.nvim is doing anything substantially incorrect, other auto-completion plugins, apart from COC, behave very similarly. It just may be a limitation of Vim's completion popup system.
@bluz71 it makes more sense now to why am having such a different experience compered to using coc. I hope completion-nvim would support floating windows as it offer better experience
Probably, this issue relates to this https://github.com/nvim-lua/completion-nvim/pull/207
I have tested coc.nvim and if I use backspace, completion popup flicker.
@hrsh7th Hmm so what's wrong with the PR though? If it solve the issue we should probably merge it.
@tami5 I don't think coc uses a floating window for completion since I've read their source code before... and even if it does I'm not planning to implement it. I think that since vim already have a completion mechanism built-in, we should try to stick to it without creating our own completion style. Also you should elaborate more on what is flicker, maybe a gif demonstrate it because I don't really get what you mean.
Ahh also @Shougo Thanks a lot for help testing it:) Really appreciate!
@haorenW1025 I'll try to paste a gif soon. Thanks for taking a look into the issue. Adding #207 workaround fix the issue to a great extent.
My previous PR was broken when using gopls.
For example, completion-nvim#master does not show any items when the line is fmt.Paaaaaa|
.
But My version shows Print
Printf
Println
unexpectedly.
@tami5 After some investigation, I think I know why the flickering happens. This is because when supporting fuzzy completion we'll have to manually triggered complete instead of let neovim filter the results, which eventually causes the flickering(see https://github.com/neovim/neovim/issues/12620 for more discussion about it). Currently I can only avoid flickering when not using fuzzy complete. Please see if using #249 with setting completion_matching_strategy_list = {'exact'}
work for you.
Nice catch @haorenW1025, I was wondering why this isn't a real issue for the completion-nvim, and now I understand that many may not be utilizing fuzzy match. I'm going subscribe to 249, and report there. Thanks
Well if indeed I had exact matching strategy and I stated above that I saw no difference between LSC and completion.nvim. That explains why I could not see what the original poster saw.
Nice debugging.
Because this plugin can not use fuzzy mode, so I use nvim-compe instead. Waiting for a PR fix it.
My testing minimal init.vim
How to reproduce
Expected behavior Completion window doesn't flicker when a letter get typed or get deleted.