Skip to content

Commit

Permalink
apply reviewer feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <[email protected]>
  • Loading branch information
jabraham17 committed Apr 23, 2024
1 parent cc0b593 commit 5d824a2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/chpl-language-server/src/symbol_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,16 @@ def _intent_to_string(intent: Optional[str]) -> str:
# use 'intent' as the default, so if no remap no work done
return remap.get(intent, intent) if intent else ""


def _fncall_to_string(call: chapel.FnCall) -> List[Component]:
"""
Convert a call to a string
"""
comps = []

comps.extend(_node_to_string(call.called_expression()))
comps.append(_wrap_str("[" if call.used_square_brackets() else "("))
openbr, closebr = ("[", "]") if call.used_square_brackets() else ("(", ")")
comps.append(_wrap_str(openbr))
sep = ""
for a in call.actuals():
comps.append(_wrap_str(sep))
Expand All @@ -322,8 +324,8 @@ def _fncall_to_string(call: chapel.FnCall) -> List[Component]:
comps.append(_wrap_str(" = "))
comps.extend(_node_to_string(a[1]))
else:
assert(isinstance(a, chapel.AstNode))
assert isinstance(a, chapel.AstNode)
comps.extend(_node_to_string(a))
comps.append(_wrap_str("]" if call.used_square_brackets() else ")"))
comps.append(_wrap_str(closebr))

return comps

0 comments on commit 5d824a2

Please sign in to comment.