Skip to content

Track bare module_function mode with its own flag - #1869

Open
st0012 wants to merge 1 commit into
masterfrom
claude/project-thread-ixf93d
Open

st0012 wants to merge 1 commit into
masterfrom
claude/project-thread-ixf93d

Conversation

@st0012

@st0012 st0012 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

This is a follow-up to #1859. It does not change the documentation output.

#1859 stored a bare module_function as the pseudo visibility :module_function, and the visibility reader mapped it to :private. Code that reads @visibility directly gets the pseudo value.

This PR stores the mode in a separate @module_function flag. @visibility now always holds a real visibility. The visibility= writer ends the mode, the same way that a bare public, private or protected ends it in Ruby. with_container saves and restores the flag together with the visibility.

The method lists for the 13 ruby/ruby files that use a bare module_function are the same before and after this change.

Copilot AI balanced review requested due to automatic review settings October 31, 2026 14:04
@st0012 st0012 self-assigned this Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Documentation preview

View the preview

Commit: 3072b6d

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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_function with 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
st0012 force-pushed the claude/project-thread-ixf93d branch 2 times, most recently from 88f9b4a to 3072b6d Compare October 31, 2026 16:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants