From 0e7a6e8d65ed97def28f67eb560558371705af0f Mon Sep 17 00:00:00 2001 From: Jade Abraham Date: Tue, 22 Oct 2024 11:07:26 -0700 Subject: [PATCH] add parens for unary Signed-off-by: Jade Abraham --- tools/chpl-language-server/src/symbol_signature.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/chpl-language-server/src/symbol_signature.py b/tools/chpl-language-server/src/symbol_signature.py index 1529c65e968..cf12f4a2754 100644 --- a/tools/chpl-language-server/src/symbol_signature.py +++ b/tools/chpl-language-server/src/symbol_signature.py @@ -357,18 +357,18 @@ def op_to_string(op: str) -> str: return special.get(op, f" {op} ") comps = [] + paren = call.parenth_location() + if paren: + comps.append(_wrap_str("(")) if call.is_unary_op(): comps.append(_wrap_str(call.op())) comps.extend(_node_to_string(call.actual(0))) else: - paren = call.parenth_location() - if paren: - comps.append(_wrap_str("(")) comps.extend(_node_to_string(call.actual(0))) comps.append(_wrap_str(op_to_string(call.op()))) comps.extend(_node_to_string(call.actual(1))) - if paren: - comps.append(_wrap_str(")")) + if paren: + comps.append(_wrap_str(")")) return comps