Using YARD @!macro ?

Does anyone know if its possible to configure RubyMine / Intellij + ruby to understand the macro expansions in YARD.

http://www.rubydoc.info/gems/yard/file/docs/Tags.md#macro

I've defined a class method, that adds methods to my class, and documented it as follows:

 

# Defines a new dependency
# @param [Symbol] dependency_name
# @param [Class] dependency_class
# @param [Object] options
# @!macro [attach] dependency
# @return [$2] the $1 dependency
def dependency(dependency_name, dependency_class, options = {})

Then in the class I have:

dependency :contact_dao, Contact
dependency :phone_number_create, PhoneNumbers::PhoneNumberCreateService
dependency :publish, Broadcasters::Publish
dependency :logger, Rails.logger

I would expect intellij to be aware of the instance methods I've attached, but it doesn't appear to.

1
2 comments

I've noticed that I can use the attribute declaration to make intellij pick it up like so:

# @!attribute[r] phone_number_create
# @return [PhoneNumbers::PhoneNumberCreateService]
dependency :phone_number_create, PhoneNumbers::PhoneNumberCreateService

But that adds a lot of line noise that i'd rather not have to include

0

Please sign in to leave a comment.