@Override
  protected void invoke(@NotNull ActionContext context, @NotNull PyStringLiteralExpression element, @NotNull ModPsiUpdater updater) {
    final PyElementGenerator elementGenerator = PyElementGenerator.getInstance(context.project());
    final StringBuilder result = new StringBuilder();
    final List<StringNodeInfo> nodeInfos = extractStringNodesInfo(element);
    for (int i = 0; i < nodeInfos.size(); i++) {
      final StringNodeInfo info = nodeInfos.get(i);
      List<String> lines = StringUtil.split(info.getContent(), "\n", true, false);
      boolean lastLineExcluded = false;
      if (lines.size() > 1 && lines.get(lines.size() - 1).isEmpty()) {
        lastLineExcluded = true;
        lines = lines.subList(0, lines.size() - 1);
      }

      final boolean inLastNode = i == nodeInfos.size() - 1;
      for (int j = 0; j < lines.size(); j++) {
        final String line = lines.get(j);
        final boolean inLastLine = j == lines.size() - 1;

        if (info.isRaw()) {
          appendSplittedRawStringLine(result, info, line);
          if (!inLastLine || lastLineExcluded) {
            result.append(" ").append(info.getSingleQuote()).append("\\n").append(info.getSingleQuote());
          }
        }
        else {
          result.append(info.getPrefix());
          result.append(info.getSingleQuote());
          result.append(convertToValidSubString(line, info.getSingleQuote(), info.isTripleQuoted()));
          if (!inLastLine || lastLineExcluded) {
            result.append("\\n");
          }
          result.append(info.getSingleQuote());
        }
        if (!(inLastNode && inLastLine)) {
          result.append("\n");
        }
      }
    }
    if (result.indexOf("\n") >= 0) {
      result.insert(0, "(");
      result.append(")");
    }
    PyExpression expression = elementGenerator.createExpressionFromText(LanguageLevel.forElement(element), result.toString());

    final PsiElement parent = element.getParent();
    if (expression instanceof PyParenthesizedExpression &&
        (parent instanceof PyParenthesizedExpression ||
         parent instanceof PyTupleExpression ||
         parent instanceof PyArgumentList && ArrayUtil.getFirstElement(((PyArgumentList)parent).getArguments()) == element)) {
      expression = ((PyParenthesizedExpression)expression).getContainedExpression();
    }
    if (expression instanceof PyStringLiteralExpression && ((PyStringLiteralExpression)expression).isDocString()) {
      expression = elementGenerator.createStringLiteralAlreadyEscaped(result.toString());
    }
    if (expression != null) {
      element.replace(expression);
    }
  }
@Override
  protected void invoke(@NotNull ActionContext context, @NotNull PyStringLiteralExpression element, @NotNull ModPsiUpdater updater)