int (PsiMethodCallExpression call, PsiParameter parameter) { final PsiExpressionList argumentList = call.getArgumentList(); final PsiExpression[] arguments = argumentList.getExpressions(); for (int i = 0; i < arguments.length; i++) { PsiExpression argument = arguments[i]; argument = PsiUtil.skipParenthesizedExprDown(argument); if (argument instanceof PsiReferenceExpression) { final PsiElement target = ((PsiReferenceExpression)argument).resolve(); if (target == parameter) { return i; } } } return -1; }