@Override
  public void doApply(@NotNull Editor editor, @NotNull PySmartEnterProcessor processor, @NotNull PyStringLiteralExpression psiElement)
    throws IncorrectOperationException {
    final String text = psiElement.getText();
    if (StringUtil.startsWith(text, "\"\"\"")) {
      final int suffixLength = StringUtil.commonSuffixLength(text, "\"\"\"");
      if (suffixLength != 3) {
        editor.getDocument().insertString(psiElement.getTextRange().getEndOffset(), "\"\"\"".substring(suffixLength));
      }
    }
    else if (StringUtil.startsWith(text, "'''")) {
      final int suffixLength = StringUtil.commonSuffixLength(text, "'''");
      if (suffixLength != 3) {
        editor.getDocument().insertString(psiElement.getTextRange().getEndOffset(), "'''".substring(suffixLength));
      }
    }
    else if (StringUtil.startsWith(text, "\"")) {
      if (!StringUtil.endsWith(text, "\"")) {
        editor.getDocument().insertString(psiElement.getTextRange().getEndOffset(), "\"");
      }
    }
    else if (StringUtil.startsWith(text, "'")) {
      if (!StringUtil.endsWith(text, "'")) {
        editor.getDocument().insertString(psiElement.getTextRange().getEndOffset(), "'");
      }
    }
  }
@Override
  public void doApply(@NotNull Editor editor, @NotNull PySmartEnterProcessor processor, @NotNull PyStringLiteralExpression psiElement)