private static void appendFormatString(PsiPolyadicExpression expression,
                                         String formatString,
                                         boolean insertNewline,
                                         StringBuilder newExpression) {
    final boolean textBlocks = ContainerUtil.exists(expression.getOperands(),
                                                    operand -> operand instanceof PsiLiteralExpression literal && literal.isTextBlock());
    if (textBlocks) {
      newExpression.append("\"\"\"\n");
      formatString = Arrays.stream(formatString.split("\n"))
        .map(s -> PsiLiteralUtil.escapeTextBlockCharacters(s))
        .collect(Collectors.joining("\n"));
      newExpression.append(formatString);
      if (insertNewline) {
        newExpression.append('\n');
      }
      newExpression.append("\"\"\"");
    } else {
      newExpression.append('\"').append(formatString);
      if (insertNewline) {
        newExpression.append("%n");
      }
      newExpression.append('\"');
    }
  }
private static void appendFormatString(PsiPolyadicExpression expression,
                                         String formatString,
                                         boolean insertNewline,
                                         StringBuilder newExpression)