Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 15514e5

Browse files
committed
Remove pattern matching from inlay hints
1 parent 57f5a98 commit 15514e5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/syntax_tree/language_server/inlay_hints.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,10 @@ def visit_assign(node)
6969
#
7070
def visit_binary(node)
7171
case stack[-2]
72-
in Assign | OpAssign
72+
when Assign, OpAssign
7373
parentheses(node.location)
74-
in Binary[operator: operator] if operator != node.operator
75-
parentheses(node.location)
76-
else
74+
when Binary
75+
parentheses(node.location) if stack[-2].operator != node.operator
7776
end
7877

7978
super
@@ -91,9 +90,8 @@ def visit_binary(node)
9190
#
9291
def visit_if_op(node)
9392
case stack[-2]
94-
in Assign | Binary | IfOp | OpAssign
93+
when Assign, Binary, IfOp, OpAssign
9594
parentheses(node.location)
96-
else
9795
end
9896

9997
super

0 commit comments

Comments
 (0)