void (@NotNull PsiElement element) { final PsiMethodCallExpression expression = (PsiMethodCallExpression)element; final PsiExpressionList argumentList = expression.getArgumentList(); final PsiExpression argument = argumentList.getExpressions()[0]; final PsiReferenceExpression methodExpression = expression.getMethodExpression(); final PsiExpression qualifier = ExpressionUtils.getEffectiveQualifier(methodExpression); final PsiExpression strippedQualifier = PsiUtil.skipParenthesizedExprDown(qualifier); final PsiExpression strippedArgument = PsiUtil.skipParenthesizedExprDown(argument); if (strippedQualifier == null) { return; } CommentTracker tracker = new CommentTracker(); tracker.grabComments(qualifier); tracker.markUnchanged(strippedQualifier); tracker.grabComments(argument); tracker.markUnchanged(strippedArgument); final PsiElement newArgument = strippedQualifier.copy(); methodExpression.setQualifierExpression(strippedArgument); argument.replace(newArgument); tracker.insertCommentsBefore(expression); }