@Override
  public void doApply(@NotNull Editor editor, @NotNull PySmartEnterProcessor processor, @NotNull PyParameterList parameters)
    throws IncorrectOperationException {
    final PsiElement lBrace = PyPsiUtils.getChildByFilter(parameters, PyTokenTypes.OPEN_BRACES, 0);
    final PsiElement rBrace = PyPsiUtils.getChildByFilter(parameters, PyTokenTypes.CLOSE_BRACES, 0);
    final PyFunction pyFunction = as(parameters.getParent(), PyFunction.class);
    if (pyFunction != null && !PyFunctionFixer.isFakeFunction(pyFunction) && (lBrace == null || rBrace == null)) {
      final Document document = editor.getDocument();
      if (lBrace == null) {
        final String textToInsert = pyFunction.getNameNode() == null ? " (" : "(";
        document.insertString(parameters.getTextOffset(), textToInsert);
        insertParametersForMethod(pyFunction, document, parameters.getTextOffset() + textToInsert.length());
      }
      else if (parameters.getParameters().length == 0) {
        final int lBraceOffset = lBrace.getTextRange().getEndOffset();
        final int offsetWithParam = insertParametersForMethod(pyFunction, document, lBraceOffset);
        document.insertString(offsetWithParam, ")");
      }
      else {
        document.insertString(parameters.getTextRange().getEndOffset(), ")");
      }
    }
  }
@Override
  public void doApply(@NotNull Editor editor, @NotNull PySmartEnterProcessor processor, @NotNull PyParameterList parameters)