autozimu / LanguageClient-neovim

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

undefined variable s:job when calling LanguageClient#textDocument_references() #1117

Open TamaMcGlinn opened 3 years ago

TamaMcGlinn commented 3 years ago

health#LanguageClient#check

All signs above show languageclient.exe is working, and the error message shows this is before even calling the language server - in fact, this even happens in filetypes for which I have no language server installed, where I would instead expect the error message 'no language server installed for ...'

Describe the bug

When I call the LanguageClient#textDocument_references() function, I get this error:

Error detected while processing function LanguageClient#textDocument_definition[5]..LanguageClient#findLocations[9]..LanguageClient#Call[22]..LanguageClient#Write:
E121: Undefined variable: s:job
E116: Invalid arguments for function jobsend
E15: Invalid expression: !jobsend(s:job, l:message)

Environment

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

system vimrc file: "$VIM\sysinit.vim" fall-back for $VIM: "C:/Program Files/nvim/share/nvim"

Run :checkhealth for more info

To Reproduce

Steps to reproduce the behavior:

Run :call LanguageClient#textDocument_definition()

martskins commented 3 years ago

Could you confirm the output of :echo LanguageClient#binaryPath() and verify that the binary in that path is executable. I think this might be a duplicate of #619.

TamaMcGlinn commented 3 years ago

I'm on windows; everything is always executable because Microsfoot decided not to put up any pretense of security.

I don't see any connection to #619 - I am talking about an error in the vimscript, nothing to do with the binary.

However, after rebooting I am unable to reproduce the error. I have had this issue appear and disappear several times before so I am reluctant to just close it, although debugging will be very difficult.

martskins commented 3 years ago

The s:job variable is set after checking executable(binaryPath), that's why I was wondering that. Because if that call returns an unexpected value it won't set the value for s:job. Sadly I don't have a windows machine to check, but if you are happy to investigate I would suggest looking at the s:Launch function in autoload/LanguageClient.vim, maybe you can dig out some more info from there next time it happens.

serhalp commented 3 years ago

FWIW, this can also be the behavior if you haven't properly followed the installation instructions and run bash install.sh as prescribed. In that case the binary isn't present at all, which results in the above error.