Not sure if this is a bug with LanguageClient-neovim, or a bug with julia LanguageServer.jl, or not a bug at all and expected behaviour. When I call textDocument_hover(), I'm getting sensible results but with markdown that isn't being rendered:

neovim/vim version (nvim --version or vim --version):
NVIM v0.4.3
This plugin version (git rev-parse --short HEAD):
bin/languageclient --version):silent! let g:plugs['LanguageClient-neovim'].commit = 'a7d3456'
silent! let g:plugs['julia-vim'].commit = '995eae2'
call plug#begin('~/.local/share/nvim/plugged')
Plug 'JuliaEditorSupport/julia-vim'
Plug 'autozimu/LanguageClient-neovim', {'branch': 'next', 'do': 'bash install.sh'}
call plug#end()
let g:LanguageClient_autoStart = 1
let g:LanguageClient_serverCommands = {
\ 'julia': ['julia', '--startup-file=no', '--history-file=no', '-e', '
\ using LanguageServer;
\ using Pkg;
\ import StaticLint;
\ import SymbolServer;
\ env_path = dirname(Pkg.Types.Context().env.project_file);
\ debug = false;
\
\ server = LanguageServer.LanguageServerInstance(stdin, stdout, debug, env_path, "", Dict());
\ server.runlinter = true;
\ run(server);
\ '],
\ }
Steps to reproduce the behavior:
create a file like:
foo(a, b) = 3
foo(a, b, c) = 4
foo(2,3)
and when over the last foo call :call LanguageClient#textDocument_hover()
get sensible function definitions back, but with markdown backticks
I'm seeing the same with rust.
Same with both python and javascript.
Same issue with go and rust:
* NVIM v0.5.0
* LanguageClient-neovim 7c741d0
* golang.org/x/tools/gopls v0.3.1
* rust-analyzer 8a4c248
I suspect that one culprit could be the addition of left margin to the hover buffer, which could break some syntax highlighting:
I was wrong. The issue is appears to be with the way vim-markdown updates syntax: it uses several autocmds to trigger the update, but non of those fire while _LanguageClient_ is creating hover.
Locally I was able to get back the formatting by adding the following to init.vim:
augroup markdown_language_client_commands
autocmd!
autocmd WinLeave __LanguageClient__ ++nested call <SID>fixLanguageClientHover()
augroup END
function! s:fixLanguageClientHover()
setlocal modifiable
setlocal conceallevel=2
normal i
setlocal nomodifiable
endfunction
@pschuprikov fantastic, that worked! I also had to set setlocal nonu nornu below the normal i since I had BufEnter/Leave triggers. Thank you so much for posting this!
Fixed in #1139. Thanks for sharing your findings @pschuprikov
Most helpful comment
I was wrong. The issue is appears to be with the way
vim-markdownupdates syntax: it uses severalautocmds to trigger the update, but non of those fire while _LanguageClient_ is creatinghover.https://github.com/plasticboy/vim-markdown/blob/da5a7ac96f517e0fd6f886bc3fbe27156ca1f946/ftplugin/markdown.vim#L782-L791
Locally I was able to get back the formatting by adding the following to
init.vim: