Open mullermp opened 2 years ago
This is definitely an issue with parsing that should be looked into.
In the meantime, a decent workaround to avoid this error would be to declare the Struct class that YARD is looking for up top:
# Ruby will just see this as re-opening the standard Struct class and ignore it
# @private
# @api private
class Struct; end
module Types
# My struct documentation
Struct = ::Struct.new(:a)
end
Not ideal but it's a fairly easy fix if this is blocking you.
I'm not able to render documentation for a class named
Struct
within a namespace.Steps to reproduce
The minimal code to reproduce is this:
Then run
yardoc
on this.Actual Output
The rendered documentation only has:
Generated output (different example) gives this stack trace:
Expected Output
Types::Struct
would be documented as expected.Environment details:
ruby -v
): ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin19]yard -v
): yard 0.9.27I have read the Contributing Guide.