function printArrowFunctionBody(
  path,
  options,
  args,
  { bodyDoc, bodyComments, functionBody, shouldPutBodyOnSameLine },
) {
  const { node, parent } = path;

  const trailingComma =
    args.expandLastArg && shouldPrintComma(options, "all") ? ifBreak(",") : "";

  // if the arrow function is expanded as last argument, we are adding a
  // level of indentation and need to add a softline to align the closing )
  // with the opening (, or if it's inside a JSXExpression (e.g. an attribute)
  // we should align the expression's closing } with the line with the opening {.
  const trailingSpace =
    (args.expandLastArg || parent.type === "JSXExpressionContainer") &&
    !hasComment(node)
      ? softline
      : "";

  if (shouldPutBodyOnSameLine && shouldAddParensIfNotBreak(functionBody)) {
    return [
      " ",
      group([
        ifBreak("", "("),
        indent([softline, bodyDoc]),
        ifBreak("", ")"),
        trailingComma,
        trailingSpace,
      ]),
      bodyComments,
    ];
  }

  return shouldPutBodyOnSameLine
    ? [" ", bodyDoc, bodyComments]
    : [indent([line, bodyDoc, bodyComments]), trailingComma, trailingSpace];
}
@param {AstPath} path
@param {*} options
@param {*} args
@param {Object} arrowFunctionBodyPrintOptions
@param {Doc} arrowFunctionBodyPrintOptions.bodyDoc
@param {Doc[]} arrowFunctionBodyPrintOptions.bodyComments
@param {*} arrowFunctionBodyPrintOptions.functionBody
@param {boolean} arrowFunctionBodyPrintOptions.shouldPutBodyOnSameLine