yard
yard copied to clipboard
@!parse directive is ignored when it precedes an include
The release notes for the parse directive indicate that it can be used directly above a module include.
I've been trying to get this to work, but the docstring seems to be ignored in this context. I traced the issue to YARD::Handlers::Ruby::DSLHandlerMethods
, which skips docstring handling when the "dsl" method is include
.
Steps to reproduce
- Create a file test.rb matching the use case mentioned in the release notes:
module TheDynamicModule
def foobar; end
end
class MyClass
# @!parse extend TheDynamicModule
include TheDynamicModule
end
- Document with
--embed-mixins
turned on:
$ yard doc --embed-mixins test.rb
- Open doc/MyClass.html to review
Actual Output
#foobar
is listed as an instance method of MyClass:
Expected Output
#foobar
should be listed as a class method of MyClass. I can achieve this by putting the parse directive before a method declaration instead, but I expected it to work before include
as well.
# @!parse extend TheDynamicModule
def noop; end
include TheDynamicModule
Environment details:
- OS: Ubuntu 18.04.5 LTS
- Ruby version (
ruby -v
): ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] - YARD version (
yard -v
): yard 0.9.26
I have read the Contributing Guide.