fannheyward / coc-rust-analyzer

rust-analyzer extension for coc.nvim
MIT License
1.13k stars 40 forks source link

hitting enter results in new line instead of inserting selected hint #1036

Closed mrl5 closed 2 years ago

mrl5 commented 2 years ago

I've just switched from coc-rls to coc-rust-analyzer - unfortunately right away I noticed this annoyance: hitting enter creates new line instead of inserting currently selected hint:

before enter

after enter

I've found some related VSCode issues

if this is a matter of configuration for coc-rust-analyzer then:

  1. I'd appreciate some instructions how to do it
  2. consider making it default configuration

What's the output of :CocInfo

## versions

vim version: VIM - Vi IMproved 9.0 9000228
node version: v18.7.0
coc.nvim version: 0.0.82-cd5791ab 2022-08-22 22:32:45 +0800
coc.nvim directory: /home/kuba/.vim/plugged/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2022-08-22T21:04:41.242 INFO (pid:21624) [services] - registered service "rust-analyzer"
2022-08-22T21:04:41.243 INFO (pid:21624) [services] - Rust Analyzer Language Server state change: stopped => starting
2022-08-22T21:04:41.245 INFO (pid:21624) [plugin] - coc.nvim initialized with node: v18.7.0 after 86ms
2022-08-22T21:04:41.252 INFO (pid:21624) [language-client-index] - Language server "rust-analyzer" started with 21647
2022-08-22T21:04:41.264 INFO (pid:21624) [services] - Rust Analyzer Language Server state change: starting => running
2022-08-22T21:04:41.295 INFO (pid:21624) [services] - service rust-analyzer started
2022-08-22T21:04:44.270 INFO (pid:21624) [attach] - receive notification: runCommand [ 'rust-analyzer.serverVersion' ]
2022-08-22T21:04:51.182 INFO (pid:21624) [attach] - receive notification: runCommand [ 'rust-analyzer.serverVersion' ]
2022-08-22T21:04:59.550 INFO (pid:21624) [attach] - receive notification: showInfo []

What's the output of :CocCommand rust-analyzer.serverVersion

rust-analyzer 0.3.1178-standalone (a670ff888 2022-08-21)
mrl5 commented 2 years ago

I just realized that:

  1. this bug is agnostic -> not specific to coc-rust-analyzer
  2. with coc.nvim version: 0.0.80-c7d7756089 I'm not able to reproduce this
    
    ## versions

vim version: VIM - Vi IMproved 9.0 9000228 node version: v18.7.0 coc.nvim version: 0.0.80-c7d7756089 coc.nvim directory: /home/kuba/.vim/plugged/coc.nvim term: dumb platform: linux

Log of coc.nvim

2022-08-22T21:27:27.090 INFO (pid:19813) [services] - registered service "rust-analyzer" 2022-08-22T21:27:27.092 INFO (pid:19813) [services] - Rust Analyzer Language Server state change: stopped => starting 2022-08-22T21:27:27.094 INFO (pid:19813) [plugin] - coc.nvim initialized with node: v18.7.0 after 99ms 2022-08-22T21:27:27.099 INFO (pid:19813) [language-client-index] - Language server "rust-analyzer" started with 19839 2022-08-22T21:27:27.105 INFO (pid:19813) [services] - Rust Analyzer Language Server state change: starting => running 2022-08-22T21:27:27.110 INFO (pid:19813) [services] - service rust-analyzer started 2022-08-22T21:27:31.084 INFO (pid:19813) [attach] - receive notification: showInfo []

mrl5 commented 2 years ago

I've reported it here: https://github.com/neoclide/coc.nvim/issues/4082 - closing this ticket now