@Override
  public GrLiteralContainer handleContentChange(@NotNull GrLiteralContainer expr, @NotNull TextRange range, String newContent) throws IncorrectOperationException {
    if (!(expr.getValue() instanceof String)) {
//      throw new IncorrectOperationException("cannot handle content change, expr.getValue()=" + expr.getValue());
    }

    final String oldText = expr instanceof GrLiteral ? expr.getText() : expr.getParent().getText();
    final String startQuote = GrStringUtil.getStartQuote(oldText);

    if (StringUtil.startsWithChar(startQuote, '\'')) {
      newContent = GrStringUtil.escapeSymbolsForString(newContent, !startQuote.equals("'''"), true);
    }
    else if (StringUtil.startsWithChar(startQuote, '\"')) {
      newContent = GrStringUtil.escapeSymbolsForGString(newContent, !startQuote.equals("\"\"\""), false);
    }
    else if ("/".equals(startQuote)) {
      newContent = GrStringUtil.escapeSymbolsForSlashyStrings(newContent);
    }
    else if ("$/".equals(startQuote)) {
      newContent = GrStringUtil.escapeSymbolsForDollarSlashyStrings(newContent);
    }

    String newText = expr instanceof GrLiteral
                     ? oldText.substring(0, range.getStartOffset()) + newContent + oldText.substring(range.getEndOffset())
                     : newContent;
    return expr.updateText(newText);
  }
@Override
  public GrLiteralContainer handleContentChange(@NotNull GrLiteralContainer expr, @NotNull TextRange range, String newContent)