Skip to content

RDoc::Mixin needs module nesting information #1291

Open
@tompng

Description

@tompng

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions