Closed your-diary closed 5 months ago
Can't reproduce this.
@fannheyward Thank you for trying that.
Reading your response, I tried to reproduce the behavior with minimal configurations. Here are the minimal reproducible configurations:
~/.vimrc
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
let g:coc_global_extensions = ['coc-rust-analyzer']
:CocConfig
{}
~/.vim/syntax/rust.vim
set number
It seems the evil is set number
in ~/.vim/syntax/rust.vim
.
By the way, I also write set number
in ~/.vim/syntax/go.vim
, but popup window works with no problem as stated in the OP.
I also have set number
in my vimrc, will test this with syntax's.
If I remove set number
from ~/.vim/syntax/rust.vim
and instead put autocmd BufRead *.rs set number
in ~/.vimrc
, the issue disappears.
This is very strange.
The floating doc buffer uses the syntax/rust.vim
setting, display the number line in floating window, decrease the width by numberwidth
.
The problem: why the floating buffer uses syntax/rust.vim
cause its filetype is not rust.
I see...
why the floating buffer uses syntax/rust.vim cause its filetype is not rust.
To highlight the contents inside it, perhaps?
It seems the behavior is not limited to Rust. I tried Go:
" ~/.vim/syntax/go.vim
syntax match __red /./
highlight __red cterm=bold,italic ctermfg=red
set number
Reading your comment, I noticed the line numbers are also shown in the screenshot of Go though no line is missing.
To highlight the contents inside it
Yes, coc.nvim will syntax include @RUST syntax/rust.vim
, I missed this.
Made a fix in https://github.com/neoclide/coc.nvim/pull/4870, disable the number line after floating win created/reused, not perfect but works for better look.
I have this Rust code:
The doc comments of the struct
S
consist of five lines.However, when I try to show the documentation of
S
via:call CocAction('doHover')
, the last two lines of the doc comments are missing:This is extremely annoying especially when doc comments consist of one or two comments:
Though I can scroll with a mouse wheel, I think the entire doc comments should be shown (if they are short enough as in the example above).
By the way,
rust-analyzer
extension of VSCode shows the doc comments correctly.And Golang has no problem:
What's the output of
:CocInfo
What's the output of
:CocCommand rust-analyzer.serverVersion
What's your coc-rust-analyzer version? You can get it from
:CocList extensions