Skip to content

Allow skipping abstract method translation#965

Merged
vinistock merged 1 commit into
mainfrom
vs_allow_skipping_abstract_method_translation
Jun 23, 2026
Merged

Allow skipping abstract method translation#965
vinistock merged 1 commit into
mainfrom
vs_allow_skipping_abstract_method_translation

Conversation

@vinistock

@vinistock vinistock commented Jun 23, 2026

Copy link
Copy Markdown
Member

This PR introduces a new option that allows skipping the translation of abstract methods.

@vinistock vinistock self-assigned this Jun 23, 2026
@vinistock vinistock requested a review from a team as a code owner June 23, 2026 16:12
Comment thread lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs/base_translator.rb Outdated
Comment thread test/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs_test.rb Outdated

assert_equal(
<<~RUBY,
# RBS_REWRITTEN_ANNOTATION: @abstract

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's not rewritten.

The other such comment is RBS_IGNORED_UNKNOWN_ANNOTATION, which isn't right here (this is known, but intentionally ignore).

Perhaps

Suggested change
# RBS_REWRITTEN_ANNOTATION: @abstract
# RBS_IGNORED_ANNOTATION: @abstract

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's the @abstract on the class/module though. The one on methods don't get any prefix at all.

Do you think we should still add one?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh I meant to comment this on the method-level annotation.

I didn't implement the RBS_REWRITTEN_ANNOTATION comment to method-level annotations, that's just an oversight on my part. Could be nice to add it (not in this PR, and not urgent).

Those comments only exist for debuggability, to help with investigating any potential issues with the output.

@vinistock vinistock force-pushed the vs_allow_skipping_abstract_method_translation branch from 2627f49 to 1098f24 Compare June 23, 2026 17:20
@vinistock vinistock requested a review from amomchilov June 23, 2026 17:20

@amomchilov amomchilov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!


assert_equal(
<<~RUBY,
# RBS_REWRITTEN_ANNOTATION: @abstract

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh I meant to comment this on the method-level annotation.

I didn't implement the RBS_REWRITTEN_ANNOTATION comment to method-level annotations, that's just an oversight on my part. Could be nice to add it (not in this PR, and not urgent).

Those comments only exist for debuggability, to help with investigating any potential issues with the output.

Comment thread test/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs_test.rb Outdated
Comment thread lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs/base_translator.rb Outdated
@vinistock vinistock force-pushed the vs_allow_skipping_abstract_method_translation branch from 1098f24 to 97ad914 Compare June 23, 2026 18:38
@vinistock vinistock force-pushed the vs_allow_skipping_abstract_method_translation branch from 97ad914 to c10907d Compare June 23, 2026 18:48
@vinistock vinistock merged commit 7d3cb71 into main Jun 23, 2026
11 checks passed
@vinistock vinistock deleted the vs_allow_skipping_abstract_method_translation branch June 23, 2026 19:17
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.

2 participants