Merge pull request #12 from smathot/master

LspEndpoint: check server exit before parsing message
This commit is contained in:
Yeger 2020-05-04 23:40:56 +03:00 committed by GitHub
commit 3d7095a9c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -32,16 +32,15 @@ class LspEndpoint(threading.Thread):
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