tzachar/compe-tabnine

Remove repeated suffix from TN suggestion

JoseConseco opened this issue · 1 comments

Hi. When I'm making corrections in code I'm often getting TN suggestions that have same ending as rest of line eg::
image

In above case first suggestion is ok [there is no suggested ): suffix] but often I get only suggestions that ends same as the rest of line - so after autocomplete I have to remove the repeated ending. I contacted TN support, but they said the repeated suffix should be automatically gone when accepting the auto-suggestion, which is does not do.
I wonder is this something that compe-tabnine can handle - by removing those suggestions from suggestion list, or by removing repeated part after pressing ?

This is a tricky issue.
In general, nvim-compe does not support this (there are plans to add this in future releases: hrsh7th/nvim-compe#297
However, as TabNine has some support for this behaviour, it sometimes works.

See this line:

api.nvim_buf_set_text(0, row, col, row, col+len, {item.user_data.new_suffix})

So, if TabNine supplies the relevant info, this plugin uses it. Otherwise, no luck.