Skip to content

Conversation

@tompng
Copy link
Member

@tompng tompng commented Jan 24, 2026

Closes #1291

All constant/module/class paths are resolved by PrismRuby parser itself.
Resolves include/extend module name before adding it because Context#parent will not have an information for delayed full-path name resolve.

…ormation to context.parent

All constant/module/class paths are resolved by PrismRuby parser itself.
Resolves include/extend module name before adding it because `Context#parent` will not have an information for delayed full-path name resolve.
@tompng tompng temporarily deployed to fork-preview-protection January 24, 2026 19:31 — with GitHub Actions Inactive
# Need to update module parent chain to emulate Module.nesting.
# This mechanism is inaccurate and needs to be fixed.
container.parent = old_container
end
Copy link
Member Author

Choose a reason for hiding this comment

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

RDoc::Parser::Ruby updates parent only for NormalClass. This information is used by includes/extends name resolve and also in CrossReference resolve.
This is one of the reason that HTML generated by RDoc::Parser::PrismRuby and RDoc::Parser::Ruby has huge diffs.
And there is no way to reduce diff except re-implementing many bugs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changing this part to

container.parent = old_container if !singleton && container.is_a?(RDoc::NormalClass)

will minimize crossref difference of generated HTML between two parsers.
(but this change doesn't make sense. It's just re-implementing a bug)

@matzbot
Copy link
Collaborator

matzbot commented Jan 24, 2026

🚀 Preview deployment available at: https://f1a47501.rdoc-6cd.pages.dev (commit: 4776a83)

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

Successfully merging this pull request may close these issues.

RDoc::Mixin needs module nesting information

2 participants