Skip to content

Commit

Permalink
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
```
  • Loading branch information
schneems committed Dec 4, 2023
1 parent 08aaa3f commit becf097
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/syntax_suggest/explain_syntax.rb
Original file line number Diff line number Diff line change
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 becf097

Please sign in to comment.