End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
SyntaxSuggest::LeftRightLexCount#missing_pairs
missing_pairs
lib/syntax_suggest/left_right_lex_count.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/syntax_suggest/left_right_lex_count.rb, line 131
def missing_pairs
PAIRS.map do |(left, right)|
case @count_for_char[left] <=> @count_for_char[right]
when 1
right
when 0
nil
when -1
left
end
end
end
Opening characters like ‘{` need closing characters # like `}`.
When a mis-match count is detected, suggest the missing member.
For example if there are 3 ‘}` and only two `{` return `“{”`