autozimu / LanguageClient-neovim

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

Cannot disable preview window in config #1181

Closed carbolymer closed 3 years ago

carbolymer commented 3 years ago

Describe the bug

Preview window cannot be disabled through the configuration options. Following options have no effect on preview window:

    let g:LanguageClient_hoverPreview = 'Never'
    let g:LanguageClient_useFloatingHover = 1
    let g:LanguageClient_usePopupHover = 1

Environment

function LC_maps() if has_key(g:LanguageClient_serverCommands, &filetype) let g:LanguageClient_loggingFile = '/tmp/LanguageClient.log' let g:LanguageClient_serverStderr = '/tmp/LanguageClient_stderr.log' let g:LanguageClient_hoverPreview = 'Never' let g:LanguageClient_useFloatingHover = 1 let g:LanguageClient_usePopupHover = 1 endif endfunction

autocmd FileType * call LC_maps()

- Language server link and version:
https://github.com/haskell/haskell-language-server 

haskell-language-server version: 0.8.0.0 (GHC: 8.10.1) (PATH: /usr/bin/haskell-language-server-wrapper) (GIT hash: eb58f13f7b8e4f9bc771af30ff9fd82dc4309ff5)


[min-vimrc.vim]: https://github.com/autozimu/LanguageClient-neovim/blob/next/min-vimrc.vim

## To Reproduce

Bug is reproducible with any language server.
- Open source file
- Start typing function name - autocompletion should be visible
- CTRL-W to select existing function from autocompletion

## Current behavior

Hover popup opens. Preview window is opened.

## Expected behavior

Hover popup opens. Preview window is not opened.

## Screenshots
The preview window with documentation is visible at the top:
![preview_window](https://user-images.githubusercontent.com/228866/104563233-affb1080-5649-11eb-855b-ebbf1661b6e0.png)
carbolymer commented 3 years ago

Turns out it's not LanguageClient-neovim related issue. This controls preview window:

:set completeopt-=preview

vide: https://stackoverflow.com/a/22526162/1608594

ANtlord commented 3 years ago

Is it possible to disable the hover as well?

UPD: I mean is it possible to disable while selecting a completion entry? I like it when invoke it manually but I don't typing some text.

UPD2: Options to disable the hover as well is let g:LanguageClient_showCompletionDocs = 0