You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #225 it was reported that the output looks incorrect:
```
$ cat /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
def x.y.z
end
$ ruby /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
/tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb: --> /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
expected a delimiter to close the parametersunexpected '.', ignoring it
> 1 def x.y.z
> 2 end
```
Specifically:
```
expected a delimiter to close the parametersunexpected '.', ignoring it
```
However this does not show up when executing the debug executable:
```
$ bin/bundle exec exe/syntax_suggest /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
--> /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
expected a delimiter to close the parameters
unexpected '.', ignoring it
> 1 def x.y.z
> 2 end
```
This is because `exe/syntax_suggest` uses STDOUT.puts while calling `ruby` with the filename uses a fake IO object represented by MiniStringIO. This class was incorrectly not adding a newline to the end of the print.
The fix was to move the class to it's own file where it can be tested and then fix the behavior.
close#225
Co-authored-by: Andy Yong <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
## HEAD (unreleased)
2
2
3
+
- Fix: Separate multiple parser errors by newline. (https://github.com/ruby/syntax_suggest/pull/232)
4
+
3
5
## 2.0.1
4
6
5
7
- Fix CLI failure when shipped with default gems. (https://github.com/ruby/syntax_suggest/pull/226 and https://github.com/ruby/syntax_suggest/pull/227)
0 commit comments