Skip to content

Commit 0085fd3

Browse files
committed
Expand on existing example to indicate what it's showing
1 parent a25902b commit 0085fd3

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/syntax_suggest/visitor.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,18 @@ def visit_call_node(node)
4545
call_operator_loc = node.call_operator_loc
4646
message_loc = node.message_loc
4747
if receiver_loc && call_operator_loc && message_loc
48-
# foo
49-
# .bar
48+
# dot-leading (dot on the next line)
49+
# foo # line 1 — consecutive
50+
# .bar # line 2
5051
if receiver_loc.end_line != call_operator_loc.start_line && call_operator_loc.start_line == message_loc.start_line
5152
(receiver_loc.end_line..call_operator_loc.start_line - 1).each do |line|
5253
@consecutive_lines[line] = true
5354
end
5455
end
5556

56-
# foo.
57-
# bar
57+
# dot-trailing (dot on the same line as the receiver)
58+
# foo. # line 1 — consecutive
59+
# bar # line 2
5860
if receiver_loc.end_line == call_operator_loc.start_line && call_operator_loc.start_line != message_loc.start_line
5961
(call_operator_loc.start_line..message_loc.start_line - 1).each do |line|
6062
@consecutive_lines[line] = true

0 commit comments

Comments
 (0)