Skip to content

[pull] master from ruby:master#209

Merged
pull[bot] merged 2 commits into
sysfce2:masterfrom
ruby:master
Jun 23, 2026
Merged

[pull] master from ruby:master#209
pull[bot] merged 2 commits into
sysfce2:masterfrom
ruby:master

Conversation

@pull

@pull pull Bot commented Jun 23, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

st0012 added 2 commits June 23, 2026 14:44
## Problem

RDoc already supports parser classes that register handled file names
through
[`parse_files_matching`](https://ruby.github.io/rdoc/RDoc/Parser.html#method-c-parse_files_matching),
but `.rbs` documentation parsing currently comes from the `rbs` gem's
`rdoc/discover` hook, which defines `RDoc::Parser::RBS` and delegates to
`RBS::RDocPlugin::Parser` at runtime ([discovery
hook](https://github.com/ruby/rbs/blob/master/lib/rdoc/discover.rb),
[plugin
parser](https://github.com/ruby/rbs/blob/master/lib/rdoc_plugin/parser.rb)).
That leaves RBS documentation generation coupled to a separately
released plugin even though RDoc already uses RBS for type-signature
display ([#1665](#1665)), and
internal RDoc API changes can break the plugin independently of RDoc
releases ([#1711](#1711)).

## Solution

- Add `RDoc::Parser::RBS` inside RDoc, adapted from the existing RBS
plugin parser, so `.rbs` files are registered as RDoc input and common
RBS declarations/members become RDoc code objects ([RBS plugin
parser](https://github.com/ruby/rbs/blob/master/lib/rdoc_plugin/parser.rb),
[PR diff](https://github.com/ruby/rdoc/pull/1728/files)).
- Extend existing Ruby-source documentation when matching RBS
declarations are parsed, while still generating documentation for
classes, modules, methods, attributes, and constants that only appear in
RBS ([PR diff](https://github.com/ruby/rdoc/pull/1728/files)).
- Keep RDoc's existing `sig/**/*.rbs` type-signature loading path and
skip the released `rbs` discovery hook when RDoc's parser is available,
so RubyGems discovery does not replace the in-tree parser
([#1665](#1665), [discovery
hook](https://github.com/ruby/rbs/blob/master/lib/rdoc/discover.rb), [PR
diff](https://github.com/ruby/rdoc/pull/1728/files)).
## Problem

While reviewing #1571, I noticed a small follow-up refactoring
opportunity in the superclass-method notice rendered by the HTML
templates.

Both Aliki and Darkfish were reaching through `method.formatter`
directly to build the superclass method link. That leaves template code
responsible for formatter details and makes the escaping boundary less
explicit.

## Solution

- Add `RDoc::AnyMethod#superclass_method_link` as the generator-facing
helper for rendering the superclass method link.
- Escape the visible link text inside that helper while preserving the
raw method name for cross-reference lookup.
- Update the Aliki and Darkfish templates to call the new helper instead
of constructing formatter links directly.
- Cover the helper behavior with a generator markup unit test, including
operator method names such as `<<`.
@pull pull Bot locked and limited conversation to collaborators Jun 23, 2026
@pull pull Bot added the ⤵️ pull label Jun 23, 2026
@pull pull Bot merged commit daa7768 into sysfce2:master Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant