void (@NotNull InsertionContext context) { PsiReferenceExpression ref = findReference(context, context.getTailOffset() - 1); if (ref != null && ref.getParent() instanceof PsiMethodCallExpression) { PsiExpressionList argList = ((PsiMethodCallExpression)ref.getParent()).getArgumentList(); if (argList.getExpressionCount() == 0) { PsiDocumentManager.getInstance(argList.getProject()).doPostponedOperationsAndUnblockDocument(context.getDocument()); context.getDocument().deleteString(argList.getTextRange().getStartOffset(), argList.getTextRange().getEndOffset()); } } }