Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using python-language-server==0.21.2 #104

Open
mwilliammyers opened this issue Sep 21, 2018 · 1 comment
Open

Error using python-language-server==0.21.2 #104

mwilliammyers opened this issue Sep 21, 2018 · 1 comment

Comments

@mwilliammyers
Copy link

mwilliammyers commented Sep 21, 2018

I am receiving the following error intermittently (but fairly frequently):

Error detected while processing function <lambda>1[1]..16[2]..lsc#protocol#consumeMessage[1]..<SNR>85_consumeMessage:         
line   15:
E474: Attempt to decode a blank string
Press ENTER or type command to continue

I am still trying to track down exactly when this happens, but thought I would go ahead and create an issue in case anyone else is having a similar issue... I have even tried debugging the server and adding echos in the client but can't seem to catch it...

I have seen it on macOS 10.10 and Ubuntu 18.04.

I am using'python-language-server[all]' pyls-mypy pyls-isort:

python-jsonrpc-server==0.0.1
python-language-server==0.21.2
yapf==0.24.0
mypy==0.630
isort==4.3.4
jedi==0.12.1

config (I have observed this across several versions, but I am running 908bb50 right now):

let g:lsc_auto_map = v:true

let g:lsc_server_commands = {
  \ 'rust': 'rls',
  \ 'javascript': 'javascript-typescript-stdio',
  \ 'python': 'pyls',
  \ }

The only plugin that I could see affecting LSC is Neoformat.

Haven't looked too fair into the code, but it might be just a simple if statement before doing a JSON decode. If so, I would be happy to open a PR.

@natebosch
Copy link
Owner

A few things that are confusing to me:

  1. That line is already in a try/catch and I don't know why this exception would slip by:
    try
    let content = json_decode(payload)
    if type(content) != v:t_dict | throw 1 | endif
    catch
    call lsc#message#error('Could not decode message: '.payload)
    endtry
  2. I don't know why a server would try to send an empty message.
  3. On my vim if I json_decode('') I get back v:none, not a throw

If you can track down the conditions that lead to this I'd accept a patch, unfortunately I'm not sure I'll be able to repro on my own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants