From c175e265dae7c7192f9cf4ecbbc1c29c0491ef16 Mon Sep 17 00:00:00 2001 From: Schneems Date: Mon, 4 Dec 2023 17:34:12 -0600 Subject: [ruby/syntax_suggest] Remove duplicate error messages Before: ``` Expected a newline or semicolon after the statement Cannot parse the expression Expected a newline or semicolon after the statement Cannot parse the expression 1 describe "webmock tests" do 22 it "body" do 27 query = Cutlass::FunctionQuery.new( > 28 port: port > 29 body: body 30 ).call 34 end 35 end ``` After: ``` Expected a newline or semicolon after the statement Cannot parse the expression 1 describe "webmock tests" do 22 it "body" do 27 query = Cutlass::FunctionQuery.new( > 28 port: port > 29 body: body 30 ).call 34 end 35 end ``` https://github.com/ruby/syntax_suggest/commit/becf097e5e --- lib/syntax_suggest/explain_syntax.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/syntax_suggest') diff --git a/lib/syntax_suggest/explain_syntax.rb b/lib/syntax_suggest/explain_syntax.rb index ee7d44ea00..0d80c4d869 100644 --- a/lib/syntax_suggest/explain_syntax.rb +++ b/lib/syntax_suggest/explain_syntax.rb @@ -108,7 +108,7 @@ module SyntaxSuggest # on the original error messages def errors if missing.empty? - return GetParseErrors.errors(@code_lines.map(&:original).join) + return GetParseErrors.errors(@code_lines.map(&:original).join).uniq end missing.map { |miss| why(miss) } -- cgit v1.2.3