diff options
author | Yusuke Endoh <[email protected]> | 2023-03-17 08:52:27 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-04-06 15:45:30 +0900 |
commit | d511e6960f4b02731840d4bab381dec73e2c391f (patch) | |
tree | 06b2fd3e5f3d336cf4324e77e76fca6fdc45b00e /lib/syntax_suggest/version.rb | |
parent | 63ea6b0cf2b7fd27e22dc7b468fe65ee2c79b23a (diff) |
[ruby/syntax_suggest] The annotation must end with a new line
syntax_suggest did not work great when there is no new line at the end
of the input file.
Input:
```
def foo
end
end # No newline at end of file
```
Previous output:
```
$ ruby test.rb
test.rb: --> test.rb
Unmatched `end', missing keyword (`do', `def`, `if`, etc.) ?
> 1 def foo
> 2 end
> 3 end # No newline at end of filetest.rb:3: syntax error, unexpected `end' (SyntaxError)
end # No newline at end of file
^~~
```
Note that "test.rb:3: ..." is appended to the last line of the
annotation.
This change makes sure that the annotation ends with a new line.
New output:
```
$ ruby test.rb
test.rb: --> test.rb
Unmatched `end', missing keyword (`do', `def`, `if`, etc.) ?
> 1 def foo
> 2 end
> 3 end # No newline at end of file
test.rb:3: syntax error, unexpected `end' (SyntaxError)
end # No newline at end of file
^~~
```
https://github.com/ruby/syntax_suggest/commit/db4cf9147d
Diffstat (limited to 'lib/syntax_suggest/version.rb')
0 files changed, 0 insertions, 0 deletions