PsiElement (int index) { if (myContext instanceof PsiCall) { PsiExpressionList argumentList = ((PsiCall)myContext).getArgumentList(); if (argumentList != null) { return argumentList.getExpressions()[index]; } } if (myContext instanceof PsiMethodReferenceExpression) { return ((PsiMethodReferenceExpression)myContext).getReferenceNameElement(); } throw new AssertionError(); }