End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
SyntaxSuggest::CleanDocument#take_while_including
take_while_including(range = 0..-1) { |line)| ... }
lib/syntax_suggest/clean_document.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/syntax_suggest/clean_document.rb, line 294
def take_while_including(range = 0..-1)
take_next_and_stop = false
@document[range].take_while do |line|
next if take_next_and_stop
take_next_and_stop = !(yield line)
true
end
end
Helper method for grabbing elements from document
Like take_while except when it stops iterating, it also returns the line that caused it to stop