diff options
author | Schneems <[email protected]> | 2023-12-04 17:34:12 -0600 |
---|---|---|
committer | git <[email protected]> | 2023-12-05 17:51:29 +0000 |
commit | c175e265dae7c7192f9cf4ecbbc1c29c0491ef16 (patch) | |
tree | df20bb587089748332780e236923fb95d27dbaff /lib | |
parent | 6d39d6d2143f7b910f310de0ff92772839ac72a2 (diff) |
[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')
-rw-r--r-- | lib/syntax_suggest/explain_syntax.rb | 2 |
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) } |