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

Annotations for classes with multiple sources #1812

Open
mmenanno opened this issue Mar 1, 2024 · 0 comments
Open

Annotations for classes with multiple sources #1812

mmenanno opened this issue Mar 1, 2024 · 0 comments

Comments

@mmenanno
Copy link

mmenanno commented Mar 1, 2024

I noticed in the rbi generated for activesupport, the source annotation above classes in core_ext can be only partially true, because it is picking a single source when there is multiple. For instance here

# source://activesupport//lib/active_support/core_ext/object/blank.rb#61
class FalseClass
  # source://activesupport//lib/active_support/core_ext/object/json.rb#89
  def as_json(options = T.unsafe(nil)); end

  # +false+ is blank:
  #
  #   false.blank? # => true
  #
  # @return [true]
  #
  # source://activesupport//lib/active_support/core_ext/object/blank.rb#67
  def blank?; end

  # Returns +self+.
  #
  # source://activesupport//lib/active_support/core_ext/object/to_query.rb#34
  def to_param; end
end

You can see that it lists the source as source://activesupport//lib/active_support/core_ext/object/blank.rb#61 for the class, but if you look at the methods below it you can quickly see all the other places this class is actually defined. While this is a bit of an edge case, perhaps when there are multiple we should have multiple source lines for the class?

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

1 participant