Closed luiz00martins closed 1 year ago
This is not related to this specific plugin, but to your setup in general. cmp has the following configuration options, which can be set per source, and should help you achieve what you want: https://github.com/hrsh7th/nvim-cmp/blob/8bbaeda725d5db6e4e1be2867a64b43bf547cf06/doc/cmp.txt#L427 https://github.com/hrsh7th/nvim-cmp/blob/8bbaeda725d5db6e4e1be2867a64b43bf547cf06/doc/cmp.txt#L432
I essence, cmp will query completion sources only if the pattern before the cursor matches keyword_pattern and the pattern is at least completion.keyword_length characters.
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{
name = 'cmp_tabnine',
keyword_length = 0,
keyword_pattern = '*',
},
{ name = 'path' },
{ name = 'buffer' },
}),
Now tabnine just doesn't appear. Am I doing something wrong?
you cant use just ''. its not a valid regular expression. try '.'
Yep, that works way better. It still fails at the beginning of the line though, which is one of the most important cases:
(Yes, I've scrolled through all of it, Tabnine isn't in the list)
Any idea on why?
I can confirm this does not work. I also tested directly with the tabnine process, and no results are returned when the cursor is on the first column of a new line.
It might be a tabnine bug. Can you try to recreate this using vscode and the tabnine plugin for it?
Got some slightly different behaviour on VSCode.
Sometimes it works, sometimes it doesn't:
When it doesn't, and calling Alt+] does nothing. But typing a letter and backspacing makes it work again.
I think this is a bug in tabnine. Maybe try contacting the tabnine team.
Sure, will do.
Description
My cmp-tabnine, apparently randomly, decides not to display any results after certain punctuations.
Sometimes continuing to type makes it appear, sometimes not. Sometimes running
cmp.mapping.complete()
(which I have bound to Ctrl+o) makes it appear, sometimes not. Sometimes backspacing one character makes it appear, sometimes not.Example video
Here's an example video of that I mean:
https://user-images.githubusercontent.com/43142209/208241476-633637c7-2901-4761-99d6-eec02602e0cf.mp4
lo
, it still doesn't work. However, it works after pressing Ctrl+ogetDeviceResult
=
. Even pressing Ctrl+o doesn't show it.aw
, which makes it work again, completingawait
. Same after typing(sel
, which completes(self
:
, it stops working again. Even continuing with:get
doesn't work. Nor does hitting Ctrl+o (Weirdly enough, backspacing would make it work in this scenario).(se
, completing to(serialNumber
, same for,
.'
makes it stop work again. Again, continuing with'sta
still doesn't. And again, Ctrl+o still doesn't. However, after backspacing, it works again.Note: Ignore the ghost text. It's from GH Copilot, not Tabnine.
It is very weird, and I basically never know when it's going to pop up, and when it isn't.
Now, the failures are deterministic. Each punctuation/special character (
<tab>
,:
,,
, etc) fail in the exact same way, and the mitigations (continuing to type,cmp.mapping.complete
, or backspacing) fail/succeed for each one in the exact same pattern each time. Still, it's quite weird that the bug is not consistent across them. None of the mitigations above solves them all.Config
Note: I have not yet tried to reduce my config to a MWE, mostly cuz I don't have the time right now. So, this may be some conflict with another source. I'll try to reduce the configs later.