-
Notifications
You must be signed in to change notification settings - Fork 447
Fix method source code not created if a method's description is skipped #1488
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
Merged
tompng
merged 2 commits into
ruby:master
from
extern-c:bugfix-1335-method-source-link-issue
Dec 9, 2025
+6
−10
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this will change this HTML structure:
How about moving the whole
<%- if method.token_stream %> method controls <% -end %>toThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aware of this but it also feels like source code div actually shouldn't be placed under description, if we want their display to be separate?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is no need to separate. If there's a reason to skip description, (example: it's an alias and the description/source are both visible in the original method), we don't need to show method source.
This will reduce generated HTML size especially when many aliases are defined.(edited. this part seems wrong)For
Hash#has_value?, it shouldn't skip description. #1491 will fix it from the backend side.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like
method.skip_description?andmethod.token_stream.nil?is almost identical (especially after some bug fixes of backend),I reconsidered it's OK moving method-description outside of
<%- unless method.skip_description? then %>👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @st0012 and @tompng,
Thanks for the code review! For my own understanding, would you mind confirming when
method.skip_description?is supposed to returntrue?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the source code document
Here's an example:
The same method is defined as
foo,barandbaz. But call-seq only havefooandbar.In this case, description for
bazis skipped.Actual description skipped method: https://docs.ruby-lang.org/en/master/Complex.html#method-i-angle
In other words, minor aliases that is not so worth documented, is skipped.
On the other hand,
token_streamseems to be linked to the most major method.If the most major method is skipped == treated as most minor, something should be wrong.