Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
SyntaxSuggest::CodeBlock#valid?
valid?
lib/syntax_suggest/code_block.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/syntax_suggest/code_block.rb, line 75
def valid?
if @valid == UNSET
# Performance optimization
#
# If all the lines were previously hidden
# and we expand to capture additional empty
# lines then the result cannot be invalid
#
# That means there's no reason to re-check all
# lines with the parser (which is expensive).
# Benchmark in commit message
@valid = if lines.all? { |l| l.hidden? || l.empty? }
true
else
SyntaxSuggest.valid?(lines.map(&:original).join)
end
else
@valid
end
end
No documentation available