neoclide / coc.nvim

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

Floating windows get weird looks with coc-texlab on WSL #3419

Closed krisfans closed 2 years ago

krisfans commented 3 years ago

Result from CocInfo

## versions

vim version: NVIM v0.5.0
node version: v15.14.0
coc.nvim version: 0.0.80-03c9add7cd
coc.nvim directory: /home/kris/.cache/nvim/dein/repos/github.com/neoclide/coc.nvim_release
term: xterm-256color
platform: linux

## Log of coc.nvim

2021-10-06T19:37:10.543 INFO (pid:1732) [services] - registered service "highlight"
2021-10-06T19:37:10.630 INFO (pid:1732) [services] - registered service "texlab"
2021-10-06T19:37:10.630 INFO (pid:1732) [services] - TexLab state change: stopped => starting
2021-10-06T19:37:10.644 INFO (pid:1732) [plugin] - coc.nvim 0.0.80-03c9add7cd initialized with node: v15.14.0 after 266ms
2021-10-06T19:37:10.682 INFO (pid:1732) [language-client-index] - Language server "texlab" started with 1751
2021-10-06T19:37:10.701 INFO (pid:1732) [services] - TexLab state change: starting => running
2021-10-06T19:37:10.707 INFO (pid:1732) [services] - service texlab started
2021-10-06T19:37:12.900 INFO (pid:1732) [completion-complete] - Results from: file,texlab
2021-10-06T19:37:14.517 INFO (pid:1732) [attach] - receive notification: stopCompletion []
2021-10-06T19:37:14.523 INFO (pid:1732) [attach] - Request action: doKeymap [ 'iPGJzPg==0' ]
2021-10-06T19:37:14.668 INFO (pid:1732) [attach] - Request action: doKeymap [ 'iPGJzPg==0' ]
2021-10-06T19:37:14.827 INFO (pid:1732) [attach] - Request action: doKeymap [ 'iPGJzPg==0' ]
2021-10-06T19:37:14.963 INFO (pid:1732) [attach] - Request action: doKeymap [ 'iPGJzPg==0' ]
2021-10-06T19:37:15.098 INFO (pid:1732) [attach] - Request action: doKeymap [ 'iPGJzPg==0' ]
2021-10-06T19:37:20.246 INFO (pid:1732) [attach] - receive notification: highlight []
2021-10-06T19:37:47.992 INFO (pid:1732) [attach] - receive notification: showInfo []

Describe the bug

See the gif complete

Reproduce the bug

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

autocmd BufRead,BufNewFile *.tex set filetype=tex " autocmd FileType tex set syn=tex set completeopt-=preview

let g:coc_global_extensions =[
    \ 'coc-clangd',
    \ 'coc-texlab',
    \ ]

augroup coc_event
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end

" Highlight symbol under cursor on CursorHold
autocmd CursorHold * silent call CocActionAsync('highlight')
" 刷新补全列表
autocmd TextChangedI * silent call coc#refresh()
autocmd CursorMovedI * silent call coc#refresh()
autocmd TextChangedP * silent call coc#refresh()

"Use tab for trigger completion with characters ahead and navigate
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()

inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"

function! s:check_back_space() abort
    let col = col('.') - 1
    return !col || getline('.')[col - 1]  =~# '\s'
endfunction


- Start (neo)vim with command: 
`nvim -u mini.vim test.tex`
- Operate vim.
type `\beta`
## Screenshots (optional)

If applicable, add screenshots to help explain your problem.
fannheyward commented 3 years ago
截屏2021-10-09 上午9 54 33

I did a test with your configurations on macOS, can't reproduce. And as you can see, the suggestions list is different from yours, there's no built-in suffix. What's your coc-texlab version? and the texlab version? I'm using 3.2.0

krisfans commented 3 years ago

my environment: wsl+ubuntu20.04+nvim 0.5.0+windows terminal+texlab 3.1. I just update texlab to v3.2, but this still exists.

krisfans commented 3 years ago

I did a test with your configurations on macOS, can't reproduce

Did you use a third party colorscheme ?

fannheyward commented 3 years ago

In your tests, the completion items all with built-in suffix?

fannheyward commented 3 years ago

third party colorscheme

Minimal vimrc, without color scheme setting.

krisfans commented 3 years ago

In your tests, the completion items all with built-in suffix?

Seems to be yes Snipaste_2021-10-09_14-27-40

Minimal vimrc, without color scheme setting.

I set colorscheme gruvbox8 in vimrc

fannheyward commented 3 years ago
  1. provides :CocList extensions and :CocList services
  2. do you have any latex settings in your coc-settings.json?

I can't get built-in in the completion items.

fannheyward commented 3 years ago

And make a test without any colorscheme please.

krisfans commented 3 years ago

minimal.vim

if &compatible
    set nocompatible               " Be iMproved
endif
set runtimepath^=~/.cache/nvim/dein/repos/github.com/neoclide/coc.nvim_release
filetype plugin indent on
syntax enable
set background=dark
set termguicolors
" colorscheme gruvbox8

autocmd BufRead,BufNewFile *.tex set filetype=tex

set completeopt-=preview

    let g:coc_global_extensions =[
        \ 'coc-clangd',
        \ 'coc-texlab',
        \ ]

coc-settings.json

{
    "suggest.timeout": 500,
    "suggest.noselect": false,
    "suggest.detailField": "abbr"
 }

step

nvim -u minimal.vim test.tex

result

complete1

note

I found set "suggest.detailField": "abbr" in coc-settings.json is the key to reproducing the problem。 If the value of suggest.detailField defaults , built-in will disappear

fannheyward commented 3 years ago

"suggest.detailField": "abbr"

Got it.

Looks like it's a problem on WSL.

chemzqm commented 2 years ago

"suggest.detailField": "abbr" means set detail of LSP complete item to abbr of vim's complete item. It's expected.