instance method
SyntaxSuggest::CodeLine#indent_index
indent_index
lib/syntax_suggest/code_line.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/syntax_suggest/code_line.rb, line 72
def indent_index
@indent_index ||= [indent, index]
end
Used for stable sort via indentation level
Ruby’s sort is not “stable” meaning that when multiple elements have the same value, they are not guaranteed to return in the same order they were put in.
So when multiple code lines have the same indentation level, they’re sorted by their index value which is unique and consistent.
This is mostly needed for consistency of the test suite