module YARD::Handlers::Ruby::DSLHandlerMethods

def find_attached_macro

def find_attached_macro
  Registry.all(:macro).each do |macro|
    next unless macro.method_object
    next unless macro_name_matches(macro)
    (namespace.inheritance_tree(true) + [P('Object')]).each do |obj|
      return macro if obj == macro.method_object.namespace
    end
  end
  nil
end