autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 272 forks source link

Floating completion item documentation appears under completion menu #1178

Open dryya opened 3 years ago

dryya commented 3 years ago
call plug#begin('~/.local/share/nvim/plugged')

Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }

call plug#end()

" Always draw sign column. Prevent buffer moving when adding/deleting sign.
set signcolumn=yes

let g:LanguageClient_serverCommands = {}
if executable('R')
    let g:LanguageClient_serverCommands.r =
        \ ['R', '--no-echo', '-e', 'languageserver::run()']
endif
if executable('pyls')
    let g:LanguageClient_serverCommands.python = ['/usr/bin/pyls']
endif

let $RUST_BACKTRACE = 1
let g:LanguageClient_loggingLevel = 'INFO'
let g:LanguageClient_virtualTextPrefix = ''
let g:LanguageClient_loggingFile =  expand('~/.local/share/nvim/LanguageClient.log')
let g:LanguageClient_serverStderr = expand('~/.local/share/nvim/LanguageServer.log')

Describe the bug

The floating documentation window for the currently selected completion implemented in #1043 will sometimes render partially underneath the completion window, making it impossible to read part of the text.

Here is an image of the behavior with R language server.

min-vimrc-bug

Here is an example with the python language server.

error-python

Environment

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"


- This plugin version (`git rev-parse --short HEAD`): a42594c
- This plugin's binary version (`bin/languageclient --version`): 0.1.161
- Minimal vimrc content: see above
- Language server link and version: https://github.com/palantir/python-language-server version 0.36.2
- https://github.com/REditorSupport/languageserver version 0.3.9

## To Reproduce

Steps to reproduce the behavior:

- Create/Fetch example project ...
- Start vim, `nvim -u min-vimrc.vim` ...
- Type the beginning of anything completable, then hit Control+X-Control+O.
- If the documentation is long and/or the floating window is large, some of it will be impossible to see.

LanguageClient.log:
[LanguageClient.log](https://github.com/autozimu/LanguageClient-neovim/files/5737038/LanguageClient.log)
martskins commented 3 years ago

This looks like the same that has been reported in this discussion thread: https://github.com/autozimu/LanguageClient-neovim/discussions/1175

I'll try and come up with a way to fix this, as it seems to be quite frequent.

dryya commented 3 years ago

Apologies, I searched but didn't see that issue. As you mentioned there, in many cases it definitely seems to be a lack of screen space. However, this happens to me a lot more often in R than with other language servers, and in many of those cases (like in my screenshot) the entire function documentation is a single paragraph or even sentence and should easily fit on screen. Unfortunately I don't have the skills to tackle this issue myself, so I appreciate you looking into it.