<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/syntax_suggest/core_ext.rb, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/syntax_suggest] Fix missing line break due to puts logic</title>
<updated>2024-11-15T01:31:26+00:00</updated>
<author>
<name>Schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2024-11-15T00:54:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=226cfda3069c76c094d294a68585b5772fcc730a'/>
<id>226cfda3069c76c094d294a68585b5772fcc730a</id>
<content type='text'>
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: --&gt; /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
expected a delimiter to close the parametersunexpected '.', ignoring it
&gt; 1  def x.y.z
&gt; 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
--&gt; /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb

expected a delimiter to close the parameters
unexpected '.', ignoring it

&gt; 1  def x.y.z
&gt; 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 https://github.com/ruby/syntax_suggest/pull/225

https://github.com/ruby/syntax_suggest/commit/d2ecd94a3b

Co-authored-by: Andy Yong &lt;andyywz@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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: --&gt; /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
expected a delimiter to close the parametersunexpected '.', ignoring it
&gt; 1  def x.y.z
&gt; 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
--&gt; /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb

expected a delimiter to close the parameters
unexpected '.', ignoring it

&gt; 1  def x.y.z
&gt; 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 https://github.com/ruby/syntax_suggest/pull/225

https://github.com/ruby/syntax_suggest/commit/d2ecd94a3b

Co-authored-by: Andy Yong &lt;andyywz@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] [DOC] Fix method name</title>
<updated>2023-06-28T07:34:53+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-06-14T06:53:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ae71bbbc44e9389e229c039d4717b1e7bcf63631'/>
<id>ae71bbbc44e9389e229c039d4717b1e7bcf63631</id>
<content type='text'>
https://github.com/ruby/syntax_suggest/commit/08a9afb64f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/syntax_suggest/commit/08a9afb64f
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] The annotation must end with a new line</title>
<updated>2023-04-06T06:45:30+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2023-03-16T23:52:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d511e6960f4b02731840d4bab381dec73e2c391f'/>
<id>d511e6960f4b02731840d4bab381dec73e2c391f</id>
<content type='text'>
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: --&gt; test.rb
Unmatched `end', missing keyword (`do', `def`, `if`, etc.) ?
&gt; 1  def foo
&gt; 2  end
&gt; 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: --&gt; test.rb
Unmatched `end', missing keyword (`do', `def`, `if`, etc.) ?
&gt; 1  def foo
&gt; 2  end
&gt; 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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: --&gt; test.rb
Unmatched `end', missing keyword (`do', `def`, `if`, etc.) ?
&gt; 1  def foo
&gt; 2  end
&gt; 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: --&gt; test.rb
Unmatched `end', missing keyword (`do', `def`, `if`, etc.) ?
&gt; 1  def foo
&gt; 2  end
&gt; 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
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] Hide internal document and detail of `Kernel` monkey patching</title>
<updated>2023-01-27T02:31:10+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-01-07T09:45:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=06e30df4083779df7981105167e908fc780454fd'/>
<id>06e30df4083779df7981105167e908fc780454fd</id>
<content type='text'>
https://bugs.ruby-lang.org/issues/19285

https://github.com/ruby/syntax_suggest/commit/25ca82f8f9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://bugs.ruby-lang.org/issues/19285

https://github.com/ruby/syntax_suggest/commit/25ca82f8f9
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge syntax_suggest master</title>
<updated>2022-12-09T07:36:22+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2022-12-09T06:12:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0677bbe3ff139a4f369c128bdab3526450c5ee6f'/>
<id>0677bbe3ff139a4f369c128bdab3526450c5ee6f</id>
<content type='text'>
  Pick from https://github.com/ruby/syntax_suggest/commit/daee74dcb06296fa69fe8595fdff5d93d432b30d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  Pick from https://github.com/ruby/syntax_suggest/commit/daee74dcb06296fa69fe8595fdff5d93d432b30d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] Add temp support for 3.2.0-preview{3,2,1}</title>
<updated>2022-12-02T00:36:40+00:00</updated>
<author>
<name>schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2022-12-01T19:27:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=85a1c67a6550641e5de96cdbee1713be3f1e8882'/>
<id>85a1c67a6550641e5de96cdbee1713be3f1e8882</id>
<content type='text'>
This SyntaxError#path feature only exists in Ruby HEAD. Until it is released in a preview I want to continue to support existing releases of 3.2.0 (and also so CI will continue to work, as it still uses a preview version to execute tests).

https://github.com/ruby/syntax_suggest/commit/9862032465
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This SyntaxError#path feature only exists in Ruby HEAD. Until it is released in a preview I want to continue to support existing releases of 3.2.0 (and also so CI will continue to work, as it still uses a preview version to execute tests).

https://github.com/ruby/syntax_suggest/commit/9862032465
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] No longer need PathnameFromMessage with SyntaxError#path.</title>
<updated>2022-12-02T00:36:39+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2022-12-01T10:45:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=652e2d8f5d0e0210a4ef3cb541504433dbae57b3'/>
<id>652e2d8f5d0e0210a4ef3cb541504433dbae57b3</id>
<content type='text'>
  https://bugs.ruby-lang.org/issues/19138

  Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;

https://github.com/ruby/syntax_suggest/commit/8e1e7b3298
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  https://bugs.ruby-lang.org/issues/19138

  Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;

https://github.com/ruby/syntax_suggest/commit/8e1e7b3298
</pre>
</div>
</content>
</entry>
<entry>
<title>Sync SyntaxSuggest</title>
<updated>2022-08-19T01:02:24+00:00</updated>
<author>
<name>schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2022-07-26T20:21:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=490af8dbdb66263f29d0b4e43752fbb298b94862'/>
<id>490af8dbdb66263f29d0b4e43752fbb298b94862</id>
<content type='text'>
```
$ tool/sync_default_gems.rb syntax_suggest
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
$ tool/sync_default_gems.rb syntax_suggest
```
</pre>
</div>
</content>
</entry>
</feed>
