class SyntaxTree::CallChainFormatter
def format_child(
def format_child( q, child, skip_comments: false, skip_operator: false, skip_attached: false ) # First, format the actual contents of the child. case child when CallNode q.group do if !skip_operator && child.operator q.format(CallOperatorFormatter.new(child.operator)) end q.format(child.message) if child.message != :call child.format_arguments(q) unless skip_attached end when MethodAddBlock q.format(child.block) unless skip_attached end # If there are any comments on this node then we need to explicitly print # them out here since we're bypassing the normal comment printing. if child.comments.any? && !skip_comments child.comments.each do |comment| comment.inline? ? q.text(" ") : q.breakable_space comment.format(q) end q.break_parent end end