class RDoc::Parser::PrismRuby::RDocVisitor::MethodSignatureVisitor

:nodoc:

def initialize

def initialize
  @params = nil
  @calls_super = false
  @yields = []
end

def scan_signature(def_node)

def scan_signature(def_node)
  visitor = new
  def_node.body&.accept(visitor)
  params = "(#{def_node.parameters&.slice})"
  block_params = visitor.yields.first
  [params, block_params, visitor.calls_super]
end

def visit_def_node(node)

def visit_def_node(node)
  # stop traverse inside nested def
end

def visit_forwarding_super_node(node)

def visit_forwarding_super_node(node)
  @calls_super = true
end

def visit_super_node(node)

def visit_super_node(node)
  @calls_super = true
  super
end

def visit_yield_node(node)

def visit_yield_node(node)
  @yields << (node.arguments&.slice || '')
end