class method
SyntaxSuggest.valid_without?
valid_without?(without_lines:, code_lines:)
lib/syntax_suggest/api.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/syntax_suggest/api.rb, line 146
def self.valid_without?(without_lines:, code_lines:)
lines = code_lines - Array(without_lines).flatten
lines.empty? || valid?(lines)
end
SyntaxSuggest.valid_without? [Private]
This will tell you if the code_lines would be valid if you removed the without_lines. In short it’s a way to detect if we’ve found the lines with syntax errors in our document yet.
code_lines = [ CodeLine.new(line: "def foo\n", index: 0) CodeLine.new(line: " def bar\n", index: 1) CodeLine.new(line: "end\n", index: 2) ] SyntaxSuggest.valid_without?( without_lines: code_lines[1], code_lines: code_lines ) # => true SyntaxSuggest.valid?(code_lines) # => false