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

Invalid RBI for Prism? #1862

Closed
andyw8 opened this issue Apr 10, 2024 · 4 comments
Closed

Invalid RBI for Prism? #1862

andyw8 opened this issue Apr 10, 2024 · 4 comments

Comments

@andyw8
Copy link
Contributor

andyw8 commented Apr 10, 2024

I haven't yet determined if this is an issue in Prism or Tapioca:

When generating the RBI for the latest Prism (v0.25.0), it fails with:

  RBIs exported by `prism` contain errors and can't be used:
Cause: duplicated argument name. (/Users/andyw8/.gem/ruby/3.3.0/gems/prism-0.25.0/rbi/prism.rbi:50:58)

The RBI entry contains the offset argument twice:

  sig { params(source: String, filepath: T.nilable(String), line: T.nilable(Integer), offset: T.nilable(Integer), encoding: T.nilable(Encoding), frozen_string_literal: T.nilable(T::Boolean), verbose: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]])).returns(T::Boolean) }
  def self.parse_failure?(source, offset: nil, line: nil, offset: nil, encoding: nil, frozen_string_literal: nil, verbose: nil, scopes: nil); end

but it's not duplicated in
https://github.com/ruby/prism/blob/5146cc2c12e2a273d7672ba7d8711c637babade0/rbi/prism.rbi#L49-L50

@andyw8
Copy link
Contributor Author

andyw8 commented Apr 10, 2024

I tried again and didn't encounter this, so I'll close for now.

@andyw8 andyw8 closed this as completed Apr 10, 2024
@andyw8
Copy link
Contributor Author

andyw8 commented Apr 11, 2024

Ok I can reproduce on Shopify/ruby-lsp#1913 with bundle exec tapioca gem prism

@kddnewton were there are changes around RBI generation that might relate to this?

@andyw8 andyw8 reopened this Apr 11, 2024
@kddnewton
Copy link
Contributor

I don't think so, I think this is a hand-written file. Can you open a PR?

@Morriar
Copy link
Collaborator

Morriar commented Apr 11, 2024

I think I already fixed it in ruby/prism#2685.

@andyw8 andyw8 closed this as completed Apr 11, 2024
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

No branches or pull requests

3 participants