LanguageClient-neovim
LanguageClient-neovim copied to clipboard
languageclient doesn't start the language server on my vimrc
- Did you upgrade to latest plugin version? Yes
- Did you upgrade to/compile latest binary? Run shell command
bin/languageclient --versionto get its version number. 0.1.161 - (Neovim users only) Did you check output of
:checkhealth LanguageClient? Yes - Did you check troubleshooting? Yes
Describe the bug
For some reason LanguageClient has stopped working on my vimrc. On min-vimrc.vim it works fine. I think I tried about everything at this point like moving the settings between the two and commenting out all other plugins, but it just doesn't work on my regular vimrc. It seems that bin/languageclient runs fine, but then it just sits there doing nothing and doesn't start the actual language server, when I use my vimrc. :LanguageClientStart seems to do nothing, and calling LanguageClient functions says the language server isn't running. If I use settings like these, there's no /tmp/LanguageClient.log or any messages whatsoever (unless of course I use min-vimrc.vim where it works fine). Wrapper server also does nothing (except when I use min-vimrc.vim).
let g:LanguageClient_loggingLevel = 'DEBUG'
let g:LanguageClient_loggingFile = "/tmp/LanguageClient.log"
I'm a bit out of ideas at this point. I ran languageclient through a script like wrapper-server.sh, here's its output if it helps: wrapper-lc.log
I recorded straces with min-vimrc.vim and with my vimrc, I couldn't quite see what the issue is from it, but I could see that languageclient never execves anything with my vimrc. In fact when all other plugins are commented out there's no other execve in the log.
Environment
- neovim/vim version (
nvim --versionorvim --version): NVIM v0.4.4 - This plugin version (
git rev-parse --short HEAD): a42594c - This plugin's binary version (
bin/languageclient --version): 0.1.161 - Minimal vimrc content (A minimal vimrc is the smallest vimrc that could reproduce the issue. Refer to an example here):
- Language server link and version: rust-analyzer 1a59f75
Can you share your vimrc? I'm pretty sure this has to be some misconfiguration.Meanwhile, I'll see to edit the sync_settings function so that the logging level and file are parsed and configured before anything else so that it can output errors correctly.
@YaLTeR this branch should be a little more helpful: https://github.com/autozimu/LanguageClient-neovim/pull/1192
It's not ideal, as it doesn't tell you exactly what is wrong, but it tells you the value, so maybe that helps track the error down.
@YaLTeR this branch should be a little more helpful: #1192
With this branch I got the log!
14:18:53 ERROR unnamed src/language_server_protocol.rs:108 missing field
signText14:18:53 WARN unnamed src/language_server_protocol.rs:2863 Failed to start language server automatically. missing fieldsignText
Oh, I guess something changed in the new version.
Yeah that might be either g:LanguageClient_diagnosticsDisplay or g:LanguageClient_codeLensDisplay. Let me know what you had there before, maybe we can do something to allow backwards compatibility.
I had this:
let g:LanguageClient_diagnosticsDisplay = {
\ 1: {
\ "name": "Error",
\ "texthl": "SpellBad",
\ },
\ 2: {
\ "name": "Warning",
\ "texthl": "SpellCap",
\ },
\ 3: {
\ "name": "Information",
\ "texthl": "SpellCap",
\ },
\ 4: {
\ "name": "Hint",
\ "texthl": "SpellCap",
\ },
\ }
I removed it in favor of modifying the default highlights and now it works.
I see. Yeah, we should probably allow partial settings for those like you had. I'll see if I can find some time to create a PR for that.
Or at least complain loudly :)
+1 meet same issue, I use a complete settings for diagnosticsDisplay, then everything goes fine.
in my case it is the following var set, hope there were more obvious hint of the cause~
"let g:LanguageClient_diagnosticsList = v:null 1 "let g:LanguageClient_hoverPreview = 'preview'