Skip to content

Commit

Permalink
Merge pull request #12 from smathot/master
Browse files Browse the repository at this point in the history
LspEndpoint: check server exit before parsing message
  • Loading branch information
yeger00 authored May 4, 2020
2 parents d4d59dc + 8d162af commit 3d7095a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pylspclient/lsp_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ def run(self):
while not self.shutdown_flag:
try:
jsonrpc_message = self.json_rpc_endpoint.recv_response()
if jsonrpc_message is None:
print("server quit")
break
method = jsonrpc_message.get("method")
result = jsonrpc_message.get("result")
error = jsonrpc_message.get("error")
rpc_id = jsonrpc_message.get("id")
params = jsonrpc_message.get("params")

if jsonrpc_message is None:
print("server quit")
break

if method:
if rpc_id:
# a call for method
Expand Down

0 comments on commit 3d7095a

Please sign in to comment.