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

Declare type in initializer for RubyIndexer::Enhancement #2895

Closed
wants to merge 1 commit into from

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented Nov 21, 2024

This will allow us to remove the shim from add-ons which use Sorbet, such as ruby-lsp-rails.

This will allow us to remove the shim from addons which use Sorbet,
such as ruby-lsp-rails.
@andyw8 andyw8 added chore Chore task server This pull request should be included in the server gem's release notes labels Nov 21, 2024
@andyw8 andyw8 requested a review from a team as a code owner November 21, 2024 17:24
@@ -33,7 +33,7 @@ def clear

sig { params(listener: DeclarationListener).void }
def initialize(listener)
@listener = listener
@listener = T.let(listener, RubyIndexer::DeclarationListener)
Copy link
Member

Choose a reason for hiding this comment

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

How will this eliminate the need for the shim? Tapioca doesn't carry instance variable declarations to the RBIs AFAIK.

Also, Sorbet already knows the right type for @listener thanks to the method signature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah true.

Would it be possible to distribute the shim with this gem?

Copy link
Member

Choose a reason for hiding this comment

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

We can try, but I'm not sure if Tapioca picks up instance variable types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No luck, closing.

@andyw8 andyw8 closed this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore task server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants