void (@NotNull ActionContext context, @NotNull PsiReferenceExpression place, @NotNull ModPsiUpdater updater) { String qualifier = null; final PsiExpression qualifierExpression = place.getQualifierExpression(); if (qualifierExpression != null) { qualifier = qualifierExpression.getText(); } Project project = context.project(); PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project); PsiMethodCallExpression callExpression; final String call = (qualifier != null ? qualifier + "." : "") + myMethodName; if (!myIsSetter) { callExpression = (PsiMethodCallExpression)elementFactory.createExpressionFromText(call + "()", null); callExpression = (PsiMethodCallExpression)CodeStyleManager.getInstance(project).reformat(callExpression); place.replace(callExpression); } else { PsiElement parent = PsiTreeUtil.skipParentsOfType(place, PsiParenthesizedExpression.class); if (parent instanceof PsiAssignmentExpression) { final PsiExpression rExpression = ((PsiAssignmentExpression)parent).getRExpression(); final String argList = rExpression != null ? rExpression.getText() : ""; callExpression = (PsiMethodCallExpression)elementFactory.createExpressionFromText(call + "(" + argList + ")", null); callExpression = (PsiMethodCallExpression)CodeStyleManager.getInstance(project).reformat(callExpression); parent.replace(callExpression); } } }