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

TabNine completion limited to one word #3543

Closed
OsKaR31415 opened this issue Jan 3, 2022 · 3 comments
Closed

TabNine completion limited to one word #3543

OsKaR31415 opened this issue Jan 3, 2022 · 3 comments

Comments

@OsKaR31415
Copy link

OsKaR31415 commented Jan 3, 2022

Result from CocInfo

versions

vim version: VIM - Vi IMproved 8.2 8023908
node version: v17.3.0
coc.nvim version: 0.0.80-f6a947a8eb
coc.nvim directory: /Users/oscarplaisant/.vim/plugged/coc.nvim
term: tmux
platform: darwin

Log of coc.nvim

2022-01-03T20:20:05.723 INFO (pid:65921) [coc-tabnine] - Using tabnine from /Users/oscarplaisant/.config/coc/extensions/coc-tabnine-data/binaries/4.0.44/aarch64-apple-darwin/TabNine
2022-01-03T20:20:05.724 INFO (pid:65921) [plugin] - coc.nvim 0.0.80-f6a947a8eb initialized with node: v17.3.0 after 40ms
2022-01-03T20:20:09.969 INFO (pid:65921) [completion-complete] - Results from: tabnine
2022-01-03T20:20:10.610 INFO (pid:65921) [completion-complete] - Results from: around,tabnine
2022-01-03T20:20:16.609 INFO (pid:65921) [attach] - receive notification: showInfo []

Description of the bug

TabNine Completion is limited to the first word, meaning that if TabNine shows the completion match list with, and i press <c-n>, i only get match written in my file.

Steps to reproduce the bug

set nocompatible
set runtimepath^=/path/to/coc.nvim
filetype plugin indent on
syntax on
set hidden
  • Start vim with command: vim -u mini.vim
  • You need to have TabNine installe (since it is what makes the bug)
  • Type a line (e.g.: match list with)
  • go on a new line, start typing the same thing again, when you see the autocompletion, choose a completion with more than one word (in my example, TabNine should show match list with when you type matc).
  • Then, the completion is only up to the end of the first word (in my example, it only completes the word match)
@fannheyward
Copy link
Member

fannheyward commented Jan 5, 2022

the completion is only up to the end of the first word

In my tests, when you do <c-n>, only the first word is shown, but after you confirm the completion, you will get the whole line. My confirm mapping:

inoremap <silent><expr> <CR> pumvisible() ? coc#_select_confirm()
      \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"

截屏2022-01-05 下午7 23 11

@OsKaR31415
Copy link
Author

Ok, thank you, indeed it works for me.
Is there a plan to extend that feature ? because i find it annoying to have to type or whatever other key each time to confirm...

@chemzqm
Copy link
Member

chemzqm commented Jan 11, 2022

It's intended for snippet to avoid unnecessary characters, use <C-y> is recommended or you can adjust config suggest.invalidInsertCharacters

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

3 participants