neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.15k stars 953 forks source link

Cannot confirm autocomplete from non-LSP sources #5038

Closed Lauchmelder23 closed 3 weeks ago

Lauchmelder23 commented 3 weeks ago

Result from CocInfo

## versions

vim version: NVIM v0.11.0-dev-211+g37bf4c572a
node version: v22.2.0
coc.nvim version: 0.0.82-c3ae5c3b 2024-05-23 20:39:40 +0800
coc.nvim directory: /home/robert/.local/share/nvim/lazy/coc.nvim
term: xterm-kitty
platform: linux

## Log of coc.nvim

2024-06-12T10:50:00.191 INFO (pid:29573) [plugin] - coc.nvim initialized with node: v22.2.0 after 152
2024-06-12T10:50:00.396 INFO (pid:29573) [attach] - receive notification: highlight []
2024-06-12T10:50:00.721 INFO (pid:29573) [attach] - receive notification: highlight []
2024-06-12T10:50:01.210 INFO (pid:29573) [services] - service tsserver started
2024-06-12T10:50:01.471 INFO (pid:29573) [attach] - receive notification: highlight []
2024-06-12T10:50:03.570 INFO (pid:29573) [attach] - receive notification: showInfo []

Describe the bug

When the completion suggestion menu is open and a completion is selected, it is not inserted if the completion comes from one of these sources:

However, completions coming from sources like [TSC] work just fine. Because of this I cannot expand suggestions for string completion. The completion menu simply closes and nothing is inserted

Reproduce the bug

We will close your issue when you don't provide minimal vimrc and we can't reproduce it

Screenshots (optional)

None

fannheyward commented 3 weeks ago

What's your confirm mapping? Like inoremap <expr> <cr> coc#pum#visible() ? coc#_select_confirm() : "\<CR>"

Lauchmelder23 commented 3 weeks ago

I mapped it to Tab using the instructions from the FAQ https://github.com/neoclide/coc.nvim/wiki/F.A.Q#how-to-use-the-tab-key-in-insert-mode-to-jump-directly-outside-pairs-of-symbols-like--

I also remember this having worked in the past. Perhaps it is a change in neovim itself? I could try using the latest stable neovim version and see if that fixes it

Lauchmelder23 commented 3 weeks ago

Indeed this fixed it. Using neovim 0.10.0 the problem disappears. Something must have changed in neovim's development branch that breaks autocompletion from some sources