Skip to content

Commit

Permalink
Merge pull request #1082 from getong/fix-expand-rust-macro-error
Browse files Browse the repository at this point in the history
fix expand rust macro
  • Loading branch information
manateelazycat authored Oct 18, 2024
2 parents be1e69e + f351f98 commit c4decea
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/handler/rust_expand_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ def process_request(self, position) -> dict:
return dict(position=position)

def process_response(self, response: Union[dict, list]) -> None:
eval_in_emacs("lsp-bridge-rust-expand-macro--update", response["name"], response["expansion"])
if response is None:
print("Error: Received None response from rust-analyzer")
return

if "name" in response and "expansion" in response:
eval_in_emacs("lsp-bridge-rust-expand-macro--update", response["name"], response["expansion"])
else:
print(f"Error: Response missing 'name' or 'expansion' keys. Response: {response}")

0 comments on commit c4decea

Please sign in to comment.