IntentionAction (PsiElement context) { if (!(context instanceof PsiExpression expression)) return null; PsiFunctionalExpression fn = PsiTreeUtil.getParentOfType(context, PsiFunctionalExpression.class, false); if (fn == null) return null; PsiExpressionList expressionList = ObjectUtils.tryCast(fn.getParent(), PsiExpressionList.class); if (expressionList == null || expressionList.getExpressionCount() != 1) return null; PsiMethodCallExpression call = ObjectUtils.tryCast(expressionList.getParent(), PsiMethodCallExpression.class); Function<PsiType, String> remapper = METHOD_NAME_ADJUSTER.mapFirst(call); if (remapper == null) return null; PsiType actualReturnType; if(expression instanceof PsiMethodReferenceExpression methodRef) { actualReturnType = PsiMethodReferenceUtil.getMethodReferenceReturnType(methodRef); } else { actualReturnType = expression.getType(); } String targetMethodName = remapper.apply(actualReturnType); if (targetMethodName == null) return null; return new AdjustFunctionContextFix(call, targetMethodName).asIntention(); }