Fix broken sidebar links for chained class aliases#1675
Draft
Fix broken sidebar links for chained class aliases#1675
Conversation
When Ruby defines chained aliases like `A = B = C` (e.g., `HTTPRequestURITooLarge = HTTPRequestURITooLong = HTTPURITooLong` in net/http), the sidebar link for the outermost alias pointed to the intermediate alias's HTML file, which is never generated. The root cause: `update_aliases` creates ClassModule objects whose `is_alias_for` references stale intermediate objects from `add_module_alias` that don't know they are aliases. Resolve through the store to follow already-processed aliases back to the real class. Also make `name_for_path` follow the alias chain recursively as a defensive measure. Fixes #1664.
Collaborator
|
🚀 Preview deployment available at: https://2ee5894b.rdoc-6cd.pages.dev (commit: 9e7ccd1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HTTPRequestURITooLarge = HTTPRequestURITooLong = HTTPURITooLonginnet/http)update_aliasesby looking up the current store entry to follow already-processed aliases back to the real classname_for_pathfollow the chain recursively as a defensive measureFixes #1664