Skip to content

@!macro cannot attach to DSL methods in @!parse #1583

Description

@UlyssesZh

@!macro cannot attach to DSL methods in @!parse.

Steps to reproduce

Write these in lib/test.rb:

# A test class.
class Test

  # @!macro [attach] property
  #   @return [$2] the $1 property
  # @!parse property :title, String

  # @!parse property :view_count, Integer
end

Run yard doc --debug.

Actual Output

No methods are documented.
image

Expected Output

It should be equivalent to this:

# A test class.
class Test

  # @!macro [attach] property
  #   @return [$2] the $1 property
  property :title, String

  property :view_count, Integer
end

image

Environment details:

  • OS: NixOS 24.05
  • Ruby version (ruby -v): 3.3.4
  • YARD version (yard -v): 0.9.37

I have read the Contributing Guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions