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

Accessing event_dict[rpc_id] raises #22

Open
christianparpart opened this issue Nov 15, 2021 · 0 comments
Open

Accessing event_dict[rpc_id] raises #22

christianparpart opened this issue Nov 15, 2021 · 0 comments

Comments

@christianparpart
Copy link

cond = self.event_dict[rpc_id]

Hey.

Many thanks for that python library. I was looking for something like this for easy LSP server testing using Python. This project seems quite idle though - are you still interested in this?

Also, I keep getting an exception wrt the above referenced line in LSP endpoint at the very end of my tests (i'm still trying to understand your library, not done yet).

# python client script is sending event exit:
# LspEndpoint.run: message received: {}
# {'jsonrpc': '2.0', 'result': 0}
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/trapni/.local/lib/python3.8/site-packages/pylspclient/lsp_endpoint.py", line 62, in run
    self.handle_result(rpc_id, result, error)
  File "/home/trapni/.local/lib/python3.8/site-packages/pylspclient/lsp_endpoint.py", line 22, in handle_result
ReadPipe: terminating
    cond = self.event_dict[rpc_id]
KeyError: None

What can I do in this situation? Mind, I may potentially use your library entirely wrong, however, my script is actually based upon your example.

One last question I'd like to sneak into, if I may: What's the ReadPipe required for? It seems that if I comment out the print(line)-line, it still seems to work. Is it just to detect when the underlying process exits?

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

1 participant