String (@NotNull PsiMethodCallExpression call) { PsiMethodCallExpression outerCall = PsiTreeUtil.getParentOfType(call, PsiMethodCallExpression.class); if (outerCall == null) return null; PsiMethod method = outerCall.resolveMethod(); if (method == null) return null; PsiExpression[] arguments = outerCall.getArgumentList().getExpressions(); PsiParameter[] parameters = method.getParameterList().getParameters(); if (parameters.length == 0) return null; for (int i = 0; i < arguments.length; i++) { if (arguments[i] == call) { int idx = i >= parameters.length ? parameters.length - 1 : i; return parameters[idx].getName(); } } return null; }