check to code-server-like
This commit is contained in:
@@ -32,10 +32,10 @@ def realtime_response(config: dict, realtime_action: dict) -> None:
|
||||
|
||||
elif rtype == "activeFile":
|
||||
file_path = realtime_action.get("filePath")
|
||||
assert isinstance(file_path, str)
|
||||
with open(file_path, "r", encoding="utf-8") as f:
|
||||
bb.active_file_content = f.read()
|
||||
bb.active_file_path = file_path
|
||||
assert isinstance(file_path, str)
|
||||
with open(os.path.join(bb.root_path, bb.active_file_content), "r", encoding="utf-8") as f:
|
||||
bb.active_file_content = f.read()
|
||||
|
||||
elif rtype == "paste":
|
||||
file_path = realtime_action.get("filePath")
|
||||
@@ -43,14 +43,14 @@ def realtime_response(config: dict, realtime_action: dict) -> None:
|
||||
bb.pasted_file_path = file_path
|
||||
bb.pasted_content = realtime_action.get("content")
|
||||
bb.active_file_path = file_path
|
||||
with open(file_path, "r", encoding="utf-8") as f:
|
||||
with open(os.path.join(bb.root_path, bb.active_file_content), "r", encoding="utf-8") as f:
|
||||
bb.active_file_content = f.read()
|
||||
|
||||
elif rtype == "fileEdit":
|
||||
file_path = realtime_action.get("filePath")
|
||||
assert isinstance(file_path, str)
|
||||
bb.active_file_path = file_path
|
||||
with open(file_path, "r", encoding="utf-8") as f:
|
||||
with open(os.path.join(bb.root_path, bb.active_file_content), "r", encoding="utf-8") as f:
|
||||
bb.active_file_content = f.read()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user