Repository navigation
Conversation
Documentation previewCommit: |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the module-function tracking refactor.
No open issues 🎉
What changed in this PR
Refactors bare module_function tracking in RDoc’s Ruby parser after #1859, separating the mode from method visibility without intending to change documentation output.
Changes:
- Replaces the pseudo visibility
:module_functionwith a dedicated flag. - Clears the mode when visibility is explicitly set.
- Saves, resets, and restores the flag when switching containers.
| File | Description |
|---|---|
lib/rdoc/parser/ruby.rb |
Tracks module-function mode separately while keeping visibility values conventional. |
Review effort: Balanced
The Ruby parser stored a bare `module_function` as the pseudo visibility `:module_function` and mapped it to `:private` in the `visibility` reader. Code that read `@visibility` directly got the pseudo value. Store the mode in `@module_function` instead. `@visibility` now always holds a real visibility. Setting a visibility ends the mode, and `with_container` saves and restores it.
st0012
force-pushed
the
claude/project-thread-ixf93d
branch
2 times, most recently
from
October 31, 2026 16:09
88f9b4a to
3072b6d
Compare
This branch has not been deployed
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.
This is a follow-up to #1859. It does not change the documentation output.
#1859 stored a bare
module_functionas the pseudo visibility:module_function, and thevisibilityreader mapped it to:private. Code that reads@visibilitydirectly gets the pseudo value.This PR stores the mode in a separate
@module_functionflag.@visibilitynow always holds a real visibility. Thevisibility=writer ends the mode, the same way that a barepublic,privateorprotectedends it in Ruby.with_containersaves and restores the flag together with the visibility.The method lists for the 13 ruby/ruby files that use a bare
module_functionare the same before and after this change.