Skip to content

Commit

Permalink
Ensure nested constants show up in class list
Browse files Browse the repository at this point in the history
  • Loading branch information
jbourassa committed Sep 19, 2024
1 parent 0158412 commit d4f9050
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- Look at 2nd argument when checking for `rb_self` to infer the scope
(class/instance) method (in addition to the 1st arg).
This is because magnus can inject a `magnus::Ruby` as the 1st argument.
- Ensure nested constants (`A::B`) show up in YARD's class list,
regardless of which order they're in rustdoc's JSON.

## v0.3.2

Expand Down
3 changes: 3 additions & 0 deletions lib/yard-rustdoc/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def parse
@entries << Statements::Struct.new(entry, methods)
end

# Ensure Foo comes before Foo::Bar
@entries.sort! { |a, b| a.name <=> b.name }

self
end

Expand Down

0 comments on commit d4f9050

Please sign in to comment.