String (@NotNull PsiExpression expression) { PsiElement parent = PsiUtil.skipParenthesizedExprUp(expression.getParent()); if (parent instanceof PsiExpressionList) { int count = ((PsiExpressionList)parent).getExpressionCount(); if (count > 1) { long index = StreamEx.of(((PsiExpressionList)parent).getExpressions()) .map(PsiUtil::skipParenthesizedExprDown).indexOf(expression).orElse(-1); if (index != -1) { return QuickFixBundle.message("fix.expression.role.nth.argument", index + 1); } } return QuickFixBundle.message("fix.expression.role.argument"); } if (parent instanceof PsiLambdaExpression) { return QuickFixBundle.message("fix.expression.role.lambda.return"); } return null; }