Skip to content

feat: support the it block parameter#2238

Open
tk0miya wants to merge 1 commit into
soutaro:masterfrom
tk0miya:claude/wonderful-cerf-oau75l
Open

feat: support the it block parameter#2238
tk0miya wants to merge 1 commit into
soutaro:masterfrom
tk0miya:claude/wonderful-cerf-oau75l

Conversation

@tk0miya

@tk0miya tk0miya commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Recognize Ruby 3.4's it (e.g. [1].map { it + 1 }) by handling the new :itblock node alongside :numblock across type checking, source mapping, diagnostics, hover, and signature help.

This requires bumping Prism::Translation::Parser33 to Parser34.

Closes #1450

Comment thread lib/steep/source.rb

def self.new_parser
Prism::Translation::Parser33.new(Builder.new).tap do |parser|
Prism::Translation::Parser34.new(Builder.new).tap do |parser|

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussion: I bumped the Prism parser from Parser33 to Parser34 to support the it parameter.
But this introduces incompatible behavior.

ruby def it 1 end [1, 2, 3].map { it } ​

With Parser33, the it inside the block is recognized as a method call to #it. With Parser34, the same it is recognized as the block's implicit parameter.

I'm afraid that this brings a breaking change. Would it be better to add a configuration for the Ruby syntax version?

@tk0miya tk0miya force-pushed the claude/wonderful-cerf-oau75l branch from b172612 to db29dfe Compare June 13, 2026 17:19
Recognize Ruby 3.4's `it` (e.g. `[1].map { it + 1 }`) by handling
the new :itblock node alongside :numblock across type checking,
source mapping, diagnostics, hover, and signature help.

This requires bumping Prism::Translation::Parser33 to Parser34.

Closes soutaro#1450
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support it (read: It is time to switch to Prism.)

1 participant