Skip to content

Remove rubyvm: keyword argument from Prism.find - #4202

Open
eregon wants to merge 1 commit into
ruby:mainfrom
eregon:find-remove-rubyvm-keyword-argument
Open

Remove rubyvm: keyword argument from Prism.find#4202
eregon wants to merge 1 commit into
ruby:mainfrom
eregon:find-remove-rubyvm-keyword-argument

Conversation

@eregon

@eregon eregon commented Aug 6, 2026

Copy link
Copy Markdown
Member

Remove the rubyvm: keyword argument from Prism.find. The internal dispatch already checks defined?(::RubyVM), so exposing this as a public parameter seems unnecessary. Removing it makes the API cleaner and makes it straightforward to test each Find implementation directly using the concrete classes.

Additionally, unified LineMethodFind, LineLambdaFind, and LineProcFind into a single LineCallableFind class, since they share the same structure (parse file, match by start line).

@eregon
eregon requested review from Earlopain and kddnewton August 6, 2026 20:20
@eregon

eregon commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

(CI seems to not run because of a GitHub Actions outage)

* This does not scale well with more find implementations.
* RubyVM is CRuby-specific and experimental so not something usually exposed in public APIs.
* Tests can use the specific class directly, which is more reliable.
* Unify the Line*Find implementations for Proc, Method and UnboundMethod
  since they have similar logic and are easier to test that way.
@eregon
eregon force-pushed the find-remove-rubyvm-keyword-argument branch from 80cf417 to fe57f42 Compare August 7, 2026 15:32
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.

1 participant