Fix section comments with the prism parser#1639
Merged
Merged
Conversation
The section expects a non-formatted comment. Closes ruby#1638 Can be simplified once the ripper parser is removed. It currently passes the comment text as is and transforms it in the section class itself. The prism parser now does it outside of that class.
Collaborator
|
🚀 Preview deployment available at: https://03783c69.rdoc-6cd.pages.dev (commit: 66a644d) |
st0012
pushed a commit
to st0012/rdoc
that referenced
this pull request
May 3, 2026
Earlopain split section-comment extraction out of Section#extract_comment in ruby#1639 and added the TODO "Remove when the ripper parser has been removed". With ripper gone, the Ruby parser's own extract_section_comment is the only path that fires; every production caller hands Section.add_comment a comment that has already been stripped of the ":section:" header. - Drop Section#extract_comment, and simplify Section#add_comment to just validate and append. - Update test_add_comment / test_description to pass the empty, pre-extracted comments the parser actually produces today. - Drop test_extract_comment. Also restore the explanatory note above Mixin#module that the prior commit removed too aggressively. The method's resolution dance is still live for the C parser (which passes unresolved local names); only the Ruby parser's mixins arrive pre-resolved.
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.
The section expects a non-formatted comment.
Closes #1638
Can be simplified once the ripper parser is removed. It currently passes the comment text as is and transforms it in the section class itself.
The prism parser now does it outside of that class.