Skip to content

Commit 205dabb

Browse files
committed
Merge pull request #166 from zhengbli/master
Remove obj layer usage for reload async
2 parents b3f65e3 + 1d3932c commit 205dabb

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

TypeScript.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,8 @@ def sendReplaceChangesForRegions(view, regions, insertString):
463463
cli.service.change(view.file_name(), location, endLocation, insertString)
464464

465465
def recv_reload_response(reloadResp):
466-
if reloadResp.request_seq in cli.seq_to_tempfile_name:
467-
temp_file_name = cli.seq_to_tempfile_name.pop(reloadResp.request_seq)
466+
if reloadResp["request_seq"] in cli.seq_to_tempfile_name:
467+
temp_file_name = cli.seq_to_tempfile_name.pop(reloadResp["request_seq"])
468468
if temp_file_name:
469469
cli.available_tempfile_list.append(temp_file_name)
470470

libs/serviceproxy.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,18 @@ def references(self, path, location=Location(1, 1)):
119119
response_dict = self.__comm.sendCmdSync(json_str, req_dict["seq"])
120120
return response_dict
121121

122-
def reload(self, path, alternatePath):
123-
args = { "file": path, "tmpfile": alternatePath }
122+
def reload(self, path, alternate_path):
123+
args = { "file": path, "tmpfile": alternate_path }
124124
req_dict = self.create_req_dict("reload", args)
125125
json_str = jsonhelpers.encode(req_dict)
126126
response_dict = self.__comm.sendCmdSync(json_str, req_dict["seq"])
127127
return response_dict
128128

129-
def reloadAsync(self, path, alternatePath, onCompleted):
130-
req = servicedefs.ReloadRequest(self.incrSeq(), servicedefs.ReloadRequestArgs(path, alternatePath))
131-
jsonStr = jsonhelpers.encode(req)
132-
def onCompletedJson(responseDict):
133-
obj = jsonhelpers.fromDict(servicedefs.ReloadResponse, responseDict)
134-
onCompleted(obj)
135-
self.__comm.sendCmdAsync(jsonStr, req.seq, onCompletedJson)
129+
def reloadAsync(self, path, alternate_path, on_completed):
130+
args = { "file": path, "tmpfile": alternate_path }
131+
req_dict = self.create_req_dict("reload", args)
132+
json_str = jsonhelpers.encode(req_dict)
133+
self.__comm.sendCmdAsync(json_str, req_dict["seq"], on_completed)
136134

137135
def rename(self, path, location=Location(1, 1)):
138136
args = { "file": path, "line": location.line, "offset":location.offset }

0 commit comments

Comments
 (0)