coc-rust-analyzer icon indicating copy to clipboard operation
coc-rust-analyzer copied to clipboard

Strange empty lines appearing

Open lesurp opened this issue 2 years ago • 16 comments

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

vim.log

lesurp avatar Feb 03 '23 09:02 lesurp

Another symptom of what seems to be the same problem image

lesurp avatar Feb 03 '23 10:02 lesurp

Can't reproduce.

  1. cargo new d2
  2. `cd d2
  3. vim src/main.rs
  4. :vspit to open main.rs in another win
  5. 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)

fannheyward avatar Feb 06 '23 10:02 fannheyward

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

matclab avatar Feb 23 '23 11:02 matclab

Same here.

CuihuaGu avatar Mar 01 '23 01:03 CuihuaGu

@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

fannheyward avatar Mar 01 '23 04:03 fannheyward

Indeed, a quick edition with NVIM v0.9.0-dev-1087+g96d3616a53 seems to show the problem is fixed ! Good find !

matclab avatar Mar 01 '23 11:03 matclab

@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

CuihuaGu avatar Mar 02 '23 02:03 CuihuaGu

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.

matclab avatar Mar 02 '23 06:03 matclab

I still get this, even with latest nightly. Turning off code lens appears to have fixed it for me, though.

Xandaros avatar Mar 26 '23 15:03 Xandaros

Same

odyslam avatar Mar 29 '23 04:03 odyslam

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"

oskar1233 avatar Apr 29 '23 10:04 oskar1233

There seems to be another workaround though:

  "codeLens.position": "eol"

This seems to have fixed it for me too, thanks!

gibfahn avatar May 09 '23 18:05 gibfahn

Closed with https://github.com/neoclide/coc.nvim/pull/4542

fannheyward avatar Jul 14 '23 10:07 fannheyward

This is actually still happening for me after updating coc.nvim to latest master: Screenshot 2023-07-14 at 12 28 27

The blank lines keep on stacking when I edit another Rust file in vertical split.

oskar1233 avatar Jul 14 '23 10:07 oskar1233

codeLens related, debugging on this.

fannheyward avatar Aug 24 '23 03:08 fannheyward

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. Screenshot from 2023-11-08 13-44-08

piersy avatar Nov 08 '23 13:11 piersy