Skip to content

Fix section comments with the prism parser#1639

Merged
tompng merged 1 commit into
ruby:masterfrom
Earlopain:sections-prism
Mar 12, 2026
Merged

Fix section comments with the prism parser#1639
tompng merged 1 commit into
ruby:masterfrom
Earlopain:sections-prism

Conversation

@Earlopain

Copy link
Copy Markdown
Contributor

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.

@Earlopain Earlopain had a problem deploying to fork-preview-protection March 9, 2026 13:58 — with GitHub Actions Failure
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.
@st0012 st0012 added the bug label Mar 10, 2026
@st0012 st0012 temporarily deployed to fork-preview-protection March 10, 2026 15:52 — with GitHub Actions Inactive
@matzbot

matzbot commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

🚀 Preview deployment available at: https://03783c69.rdoc-6cd.pages.dev (commit: 66a644d)

@tompng tompng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you 👍

@tompng tompng merged commit d7d58e6 into ruby:master Mar 12, 2026
73 of 74 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prism misparses section docs with separator

4 participants