aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syntax_suggest
diff options
context:
space:
mode:
authorSchneems <richard.schneeman+foo@gmail.com>2023-12-04 17:34:12 -0600
committergit <svn-admin@ruby-lang.org>2023-12-05 17:51:29 +0000
commitc175e265dae7c7192f9cf4ecbbc1c29c0491ef16 (patch)
treedf20bb587089748332780e236923fb95d27dbaff /lib/syntax_suggest
parent6d39d6d2143f7b910f310de0ff92772839ac72a2 (diff)
downloadruby-c175e265dae7c7192f9cf4ecbbc1c29c0491ef16.tar.gz
[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
Diffstat (limited to 'lib/syntax_suggest')
-rw-r--r--lib/syntax_suggest/explain_syntax.rb2
1 files changed, 1 insertions, 1 deletions
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) }