Skip to content

Fix bare module_function handling - #1859

Open
skatkov wants to merge 3 commits into
ruby:masterfrom
skatkov:fix-module-function
Open

skatkov wants to merge 3 commits into
ruby:masterfrom
skatkov:fix-module-function

Conversation

@skatkov

@skatkov skatkov commented Oct 19, 2026

Copy link
Copy Markdown
Contributor
module Bare
  module_function

  # Parses a source.
  def parse(source); end
end

RDoc 8.1.0 still reports .parse as a public instance method

Form RDoc 8.1.0
Bare module_function, then method definitions Incorrect: public instance method
module_function :parse Correct: public singleton method
module_function def parse(...) Correct: public singleton method

It should be a public singleton method.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Documentation preview

View the preview

Commit: 3d13a8f

The Prism-based Ruby parser ignored module_function without arguments, documenting subsequent methods only as public instance methods. This affected APIs such as JSON.parse, whose public singleton methods were missing from generated documentation and downstream API lookups.
@skatkov
skatkov force-pushed the fix-module-function branch from 4034a0c to 562f8f2 Compare October 19, 2026 22:30
@skatkov skatkov changed the title Fix module function Fix bare module_function handling in the Ruby parser Oct 19, 2026
@skatkov
skatkov marked this pull request as ready for review October 19, 2026 22:49
Copilot AI balanced review requested due to automatic review settings October 19, 2026 22:49

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@skatkov skatkov changed the title Fix bare module_function handling in the Ruby parser Fix bare module_function handling Oct 19, 2026

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