Skip to content

RDoc::Mixin needs module nesting information #1291

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

Open
tompng opened this issue Feb 11, 2025 · 0 comments
Open

RDoc::Mixin needs module nesting information #1291

tompng opened this issue Feb 11, 2025 · 0 comments

Comments

@tompng
Copy link
Member

tompng commented Feb 11, 2025

This two include M are not the same.

class A::B
  # A::B.include(M) with Module.nesting == [A::B]
  include M
end

class A
  class B
    # A::B.include(M) with Module.nesting == [A::B, A]
    include M
  end
end

RDoc::Mixin needs information of module nesting for correct module name lookup.

Currently, RDoc uses CodeObject#parent to represent module nesting but it changes while parsing.
Resolving module name of include/extend is done after all files are parsed. It is incorrect because it might be overwritten while parsing another file. We need something like RDoc::Mixin#module_nesting.

class A::B
  # parent of A::B is TopLevel
  include M
end

class A
  class B
    # parent of A::B changes to A
  end
end
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