Skip to content

Commit

Permalink
[ruby/syntax_suggest] Remove duplicate error messages
Browse files Browse the repository at this point in the history
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
```

ruby/syntax_suggest@becf097e5e
  • Loading branch information
schneems authored and matzbot committed Dec 5, 2023
1 parent 6d39d6d commit c175e26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/syntax_suggest/explain_syntax.rb
Expand Up @@ -108,7 +108,7 @@ def why(miss)
# 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) }
Expand Down

0 comments on commit c175e26

Please sign in to comment.