End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
SyntaxSuggest::AroundBlockScan#capture_neighbor_context
capture_neighbor_context
lib/syntax_suggest/around_block_scan.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/syntax_suggest/around_block_scan.rb, line 108
def capture_neighbor_context
lines = []
kw_count = 0
end_count = 0
before_lines.reverse_each do |line|
next if line.empty?
break if line.indent < @orig_indent
next if line.indent != @orig_indent
kw_count += 1 if line.is_kw?
end_count += 1 if line.is_end?
if kw_count != 0 && kw_count == end_count
lines << line
break
end
lines << line
end
lines.reverse!
kw_count = 0
end_count = 0
after_lines.each do |line|
next if line.empty?
break if line.indent < @orig_indent
next if line.indent != @orig_indent
kw_count += 1 if line.is_kw?
end_count += 1 if line.is_end?
if kw_count != 0 && kw_count == end_count
lines << line
break
end
lines << line
end
lines
end
No documentation available