Using YARD @!macro ?

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

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.


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


Please sign in to leave a comment.