[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
This commit is contained in:
Schneems 2023-12-04 17:34:12 -06:00 committed by git
parent 6d39d6d214
commit c175e265da

View File

@ -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) }