coc-rust-analyzer
coc-rust-analyzer copied to clipboard
Strange empty lines appearing
Info
What's the output of :CocInfo
## versions
vim version: NVIM v0.9.0-dev-839+g3ac55fe08
node version: v18.7.0
coc.nvim version: 0.0.82-b7375d5f 2023-01-30 05:09:03 +0800
coc.nvim directory: /home/lesurp/.local/share/nvim/plugged/coc.nvim
term: xterm
platform: linux
## Log of coc.nvim
2023-02-03T10:28:13.131 INFO (pid:215005) [plugin] - coc.nvim initialized with node: v18.7.0 after 172
What's the output of :CocCommand rust-analyzer.serverVersion
[coc.nvim] rust-analyzer 0.3.1386-standalone
What's your coc-rust-analyzer version? You can get it from :CocList extensions
0.69.7
The issue itself
When I type in a Rust file I get strange "new lines" (the not-actual-lines you get when you text gets wrapped), or sometimes weird empty dashed lines (the same you get when you do a diff and a line has been deleted). Attached are a video of the empty line issue, as well as the log file.
The init.vim file:
call plug#begin()
Plug 'neoclide/coc.nvim', {
\ 'branch': 'release', 'do': ':CocInstall coc-pyright coc-vimtex coc-json coc-rust-analyzer coc-snippets coc-clangd',
\ }
call plug#end()
It happens only in Rust (python and C++ too I believe are OK) which is why I'm posting this on this repo, but I really don't know whether the main coc repo is more appropriate for this. I've had this for some weeks now, so it's not an (overly) recent regression. Maybe I'll try to downgrade things until I find the culprit, but there are many components involved so it's a bit of a hassle. If there's anything I can do to help fix this, I'll gladly contribute :)
https://user-images.githubusercontent.com/12513150/216566877-feb28b3e-b3c0-4ce0-a8fb-cb07e490967f.mp4
Another symptom of what seems to be the same problem

Can't reproduce.
cargo new d2- `cd d2
vim src/main.rs:vspitto open main.rs in another win- make any code changes, comments or real code, no empty lines
vim version: NVIM v0.9.0-dev-3534+gf9826e1df-dirty
node version: v19.6.0
coc.nvim version: 0.0.82-8c0d3ef9 2023-02-03 14:32:12 +0300
rust-analyzer 0.3.1394-standalone (0b32b65ca 2023-02-05)
Same here with
## versions
vim version: NVIM v0.8.3
node version: v16.19.0
coc.nvim version: 0.0.82-b7375d5f 2023-01-30 05:09:03 +0800
coc.nvim directory: /homecrypt/clabaut/.vim/bundle/coc.nvim
term: xterm-kitty
platform: linux
and rust-analyzer 0.3.1410-standalone and coc-rust-analyzer 0.72.1
Same here.
@matclab @CuihuaGu can you try nvim 0.9.0 nightly? I reproduced similar issues with 0.8.3, but not 0.9.0 nightly.
- https://github.com/fannheyward/coc-rust-analyzer/issues/1113
- https://github.com/neoclide/coc.nvim/issues/4511
Indeed, a quick edition with NVIM v0.9.0-dev-1087+g96d3616a53 seems to show the problem is fixed ! Good find !
@fannheyward Thanks for looking, I tried the latest prebuild release v0.9.0-dev-1086+gaa840ab56 here https://github.com/neovim/neovim/releases/, still having the same issue. @matclab Where can I get the v0.9.0-dev-1087+g96d3616a53 version?
vim version: NVIM v0.9.0-dev-1086+gaa840ab56
node version: v19.4.0
coc.nvim version: 0.0.82-b7375d5f 2023-01-30 05:09:03 +0800
coc.nvim directory: /Users/michelle/.local/share/nvim/plugged/coc.nvim
term: tmux
platform: darwin
https://user-images.githubusercontent.com/3000179/222318514-7ec78c70-baa2-44d8-a72a-6d1c9b645282.mov
I'm on arch Linux and I build it from git master branch via an AUR package. But just building it by hand should work.
I still get this, even with latest nightly. Turning off code lens appears to have fixed it for me, though.
Same
Ran into the same issue on v0.10.0:
## versions
vim version: NVIM v0.10.0-dev-1577+g3287fc2ba-Homebrew
node version: v19.2.0
coc.nvim version: 0.0.82-b7375d5f 2023-01-30 05:09:03 +0800
coc.nvim directory: /Users/oskar1233/.local/share/nvim/plugged/coc.nvim
term: tmux
platform: darwin
## Log of coc.nvim
2023-04-29T12:47:35.194 INFO (pid:67502) [attach] - receive notification: highlight []
2023-04-29T12:47:35.242 INFO (pid:67502) [plugin] - coc.nvim initialized with node: v19.2.0 after 99
2023-04-29T12:47:45.954 INFO (pid:67502) [attach] - receive notification: highlight []
2023-04-29T12:48:08.464 INFO (pid:67502) [attach] - receive notification: highlight []
Same thing happening on plain iTerm2 without tmux.
Disabling Code Lens indeed fixes the issue but it's not perfect. There seems to be another workaround though:
"codeLens.position": "eol"
There seems to be another workaround though:
"codeLens.position": "eol"
This seems to have fixed it for me too, thanks!
Closed with https://github.com/neoclide/coc.nvim/pull/4542
This is actually still happening for me after updating coc.nvim to latest master:
The blank lines keep on stacking when I edit another Rust file in vertical split.
codeLens related, debugging on this.
I can confirm that this is still affecting me.
vim version: NVIM v0.9.4
node version: v20.5.1
coc.nvim version: 0.0.82-d1568d56 2023-09-29 19:43:34 +0800
coc.nvim directory: /home/piersy/.config/nvim/plugged/coc.nvim
term: xterm-256color
platform: linux
Setting "codeLens.position": "eol" results in the code lenses stacking horizontally.