Port prototype rbi generation to prism - #3105
Open
Earlopain wants to merge 1 commit into
Open
Conversation
Earlopain
marked this pull request as ready for review
August 26, 2026 17:25
Contributor
Author
|
cc @eregon |
Apart from porting to prism, this also does the following: 1. Remove `variable` tracking for `type_of0`. It contains `AST::TypeParam` but checked for inclusion of a Symbol. There's no difference in the output even when this is fixed, so I just removed it entirely 2. Have the parse method return declarations, make it a class method. Just more convenient with the new structure. Eventually `rb prototype` will do this as well 3. Allow to use it on jruby/truffleruby. 4. Split comment parsing from comment processing in the helper. In rbi the comments now come from a plain parse. When `prototype rb` uses prism as well, `parse_comments` can be removed (as well as most of the other helper methods there) I tested this against code samples from https://github.com/Shopify/tapioca/blob/d029cc9c3f76865f61fdbaff68d75e18a0014764/spec/tapioca/gem/pipeline_spec.rb The output is largely the same, and improved in some areas. For example, `type_member` with no paren is no longer considered an untyped constant. Previously that was only the case for `type_member()` or when an argument was passed like `type_member(:out)`.
Earlopain
force-pushed
the
prototype-rbi-prism
branch
from
August 26, 2026 17:49
5e2b785 to
3d82789
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apart from porting to prism, this also does the following:
variabletracking fortype_of0.It contains
AST::TypeParambut checked for inclusion of a Symbol. There's no difference in the output even when this is fixed, so I just removed it entirelyJust more convenient with the new structure. Eventually
rb prototypewill do this as wellIn rbi the comments now come from a plain parse. When
prototype rbuses prism as well,parse_commentscan be removed (as well as most of the other helper methods there)I tested this against code samples from https://github.com/Shopify/tapioca/blob/d029cc9c3f76865f61fdbaff68d75e18a0014764/spec/tapioca/gem/pipeline_spec.rb
The output is largely the same, and improved in some areas. For example,
type_memberwith no paren is no longer considered an untyped constant. Previously that was only the case fortype_member()or when an argument was passed liketype_member(:out).For #348