Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle spaces in types during RBS translation #393

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Jan 14, 2025

I found some signatures formatted as follow:

sig { returns(Foo::
              Bar) }

While this is valid in Ruby/RBI, having spaces or new lines in a type is a syntax error in RBS.

@Morriar Morriar added the bugfix Fix a bug label Jan 14, 2025
@Morriar Morriar self-assigned this Jan 14, 2025
@Morriar Morriar requested a review from a team as a code owner January 14, 2025 20:38
RBI

tree = parse_rbi(rbi)
puts tree.string
Copy link
Member

Choose a reason for hiding this comment

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

✂️

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch, thanks!

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar merged commit 7a93edf into main Jan 15, 2025
8 checks passed
@Morriar Morriar deleted the at-rbs-spaces branch January 15, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fix a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants