@Override
  public void doApply(@NotNull Editor editor, @NotNull PySmartEnterProcessor processor, @NotNull PyElement psiElement)
    throws IncorrectOperationException {
    if (psiElement instanceof PySetLiteralExpression || psiElement instanceof PyDictLiteralExpression) {
      final PsiElement lastChild = PyPsiUtils.getPrevNonCommentSibling(psiElement.getLastChild(), false);
      if (lastChild != null && !"}".equals(lastChild.getText())) {
        editor.getDocument().insertString(lastChild.getTextRange().getEndOffset(), "}");
      }
    }
    else if (psiElement instanceof PyListLiteralExpression ||
             psiElement instanceof PySliceExpression ||
             psiElement instanceof PySubscriptionExpression) {
      final PsiElement lastChild = PyPsiUtils.getPrevNonCommentSibling(psiElement.getLastChild(), false);
      if (lastChild != null && !"]".equals(lastChild.getText())) {
        editor.getDocument().insertString(lastChild.getTextRange().getEndOffset(), "]");
      }
    }
  }
@Override
  public void doApply(@NotNull Editor editor, @NotNull PySmartEnterProcessor processor, @NotNull PyElement psiElement)