<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/syntax_suggest, branch v4.0.3</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] v2.0.3</title>
<updated>2026-01-21T18:11:17+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2026-01-21T17:40:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e4dd078a2734f1f3b7169feb4da8c68587effc6e'/>
<id>e4dd078a2734f1f3b7169feb4da8c68587effc6e</id>
<content type='text'>
https://github.com/ruby/syntax_suggest/commit/a81b92fcf2

[Bug #21847]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/syntax_suggest/commit/a81b92fcf2

[Bug #21847]
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] Refactor multi-prism version logic</title>
<updated>2026-01-21T18:11:17+00:00</updated>
<author>
<name>Schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2026-01-20T21:32:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=12203963d22a984154c1abb03782c345ba8f5129'/>
<id>12203963d22a984154c1abb03782c345ba8f5129</id>
<content type='text'>
The reason this logic for different methods branches in the class instead of internally was to be eagerly aggressive about runtime performance. This code is currently only used once for the document where it's invoked ~N times (where N is number of lines):

```ruby
module SyntaxSuggest
  class CleanDocument
    # ...
    def join_trailing_slash!
      trailing_groups = @document.select(&amp;:trailing_slash?).map do |code_line|
        take_while_including(code_line.index..) { |x| x.trailing_slash? }
      end
      join_groups(trailing_groups)
      self
    end
```

Since this is not currently a hot-spot I think merging the branches and using a case statement is a reasonable tradeoff and avoids the need to do specific version testing.

An alternative idea was presented in #241 of behavior-based testing for branch logic (which I would prefer), however, calling the code triggered requiring a `DelegateClass` when the `syntax_suggest/api` is being required.

https://github.com/ruby/syntax_suggest/commit/ab122c455f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The reason this logic for different methods branches in the class instead of internally was to be eagerly aggressive about runtime performance. This code is currently only used once for the document where it's invoked ~N times (where N is number of lines):

```ruby
module SyntaxSuggest
  class CleanDocument
    # ...
    def join_trailing_slash!
      trailing_groups = @document.select(&amp;:trailing_slash?).map do |code_line|
        take_while_including(code_line.index..) { |x| x.trailing_slash? }
      end
      join_groups(trailing_groups)
      self
    end
```

Since this is not currently a hot-spot I think merging the branches and using a case statement is a reasonable tradeoff and avoids the need to do specific version testing.

An alternative idea was presented in #241 of behavior-based testing for branch logic (which I would prefer), however, calling the code triggered requiring a `DelegateClass` when the `syntax_suggest/api` is being required.

https://github.com/ruby/syntax_suggest/commit/ab122c455f
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] Handle `on_sp` when using prism</title>
<updated>2026-01-21T18:11:17+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2026-01-20T12:38:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bbba57f22c7eb7279297e03f8124d51135a7e87a'/>
<id>bbba57f22c7eb7279297e03f8124d51135a7e87a</id>
<content type='text'>
It used to not emit this token type, but now it does.
So when a newer version of prism is present, we can fall back
to the same code that ripper uses.

Ref:
* https://github.com/ruby/ruby/pull/15914
* https://github.com/ruby/prism/pull/3859

https://github.com/ruby/syntax_suggest/commit/42a3b8f6cb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It used to not emit this token type, but now it does.
So when a newer version of prism is present, we can fall back
to the same code that ripper uses.

Ref:
* https://github.com/ruby/ruby/pull/15914
* https://github.com/ruby/prism/pull/3859

https://github.com/ruby/syntax_suggest/commit/42a3b8f6cb
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] bundle exec standardrb --fix</title>
<updated>2025-08-19T01:48:32+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-08-19T01:43:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f5efd0e74340704d546c265d9e01bc9f85dbec0c'/>
<id>f5efd0e74340704d546c265d9e01bc9f85dbec0c</id>
<content type='text'>
https://github.com/ruby/syntax_suggest/commit/54bb8ab330
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/syntax_suggest/commit/54bb8ab330
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] v2.0.2</title>
<updated>2024-11-15T16:09:30+00:00</updated>
<author>
<name>Schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2024-11-15T16:07:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2a0f8d62b6f958b4df8fd806e4fea7599f8610f9'/>
<id>2a0f8d62b6f958b4df8fd806e4fea7599f8610f9</id>
<content type='text'>
https://github.com/ruby/syntax_suggest/commit/e99b5ba287
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/syntax_suggest/commit/e99b5ba287
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] Explain why class exists</title>
<updated>2024-11-15T16:06:25+00:00</updated>
<author>
<name>Schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2024-11-15T16:02:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3a547e2539124e8ecd9b09f747fb8f516295134e'/>
<id>3a547e2539124e8ecd9b09f747fb8f516295134e</id>
<content type='text'>
https://github.com/ruby/syntax_suggest/commit/8c36b0cb35
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/syntax_suggest/commit/8c36b0cb35
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] Fix spelling</title>
<updated>2024-11-15T16:06:24+00:00</updated>
<author>
<name>Schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2024-11-15T16:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=03a77c03eb7c21995d062420dd4280b303ade820'/>
<id>03a77c03eb7c21995d062420dd4280b303ade820</id>
<content type='text'>
https://github.com/ruby/syntax_suggest/commit/9c78283363
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/syntax_suggest/commit/9c78283363
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] Freeze strings</title>
<updated>2024-11-15T16:06:24+00:00</updated>
<author>
<name>Schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2024-11-15T16:00:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7969f6791fc219ba3e3af84574344d870b44fe4f'/>
<id>7969f6791fc219ba3e3af84574344d870b44fe4f</id>
<content type='text'>
https://github.com/ruby/syntax_suggest/commit/b17bf0baca
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/syntax_suggest/commit/b17bf0baca
</pre>
</div>
</content>
</entry>
<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] Bump up 2.0.1</title>
<updated>2024-10-18T02:07:02+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-10-18T02:04:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8b4df90a24a886ed2ccb4b381d43a5f3b47d21bc'/>
<id>8b4df90a24a886ed2ccb4b381d43a5f3b47d21bc</id>
<content type='text'>
https://github.com/ruby/syntax_suggest/commit/0b9e4081c0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/syntax_suggest/commit/0b9e4081c0
</pre>
</div>
</content>
</entry>
</feed>
