Skip to content

Translate RBS multiline comments back to Sorbet sigs #736

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

Merged
merged 3 commits into from
May 20, 2025

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented May 16, 2025

Example:

#: Array[
#|   Integer
#| ]
attr_accessor :foo

#: (
#|   Integer,
#|   Integer
#| ) -> Integer
def foo(a, b); end

Is translated to:

sig { returns(T::Array[Integer]) }
attr_accessor :foo

sig { params(a: Integer, b: Integer).returns(Integer) }
def foo(a, b); end

Sadly we can't reuse the rbi gem logic for this as we visit a Prism::Node and not a RBI::Node.

@Morriar Morriar self-assigned this May 16, 2025
@Morriar Morriar requested a review from a team as a code owner May 16, 2025 21:25
@Morriar Morriar added the feature New feature label May 16, 2025
Morriar added 3 commits May 20, 2025 10:55
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar force-pushed the at-rbs-rewrite-sigs-multiline branch from 7ee9c78 to 36d5ae9 Compare May 20, 2025 14:55
@Morriar Morriar merged commit d16b219 into main May 20, 2025
8 checks passed
@Morriar Morriar deleted the at-rbs-rewrite-sigs-multiline branch May 20, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants