Files
5f2bc22560 [ruby/syntax_suggest] Prefer Ruby::Prism, the parser built into the
interpreter
(https://github.com/ruby/syntax_suggest/pull/266)

* Prefer Ruby::Prism, the parser built into the interpreter

Ruby 4.1 exposes the prism parser built into the interpreter as
Ruby::Prism, and the prism gem becomes a bundled gem
(https://bugs.ruby-lang.org/issues/22379).

syntax_suggest is loaded when a script fails to parse, so it should not
depend on the prism gem, which may be absent from the Gemfile under
bundler.  On Ruby 4.1+ use Ruby::Prism; on older Rubies keep requiring
the prism gem.

Every reference to Prism in syntax_suggest is lexically inside the
SyntaxSuggest module, so defining SyntaxSuggest::Prism is enough and
the call sites are untouched.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Update lib/syntax_suggest/api.rb

* Update CHANGELOG.md

* Apply suggestion from @Earlopain

---------

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

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Earlopain <[email protected]>
2026-10-22 08:02:58 +00:00
..