GrReferenceExpression (PsiElement element) { if ((element instanceof GrReferenceExpression)) { return (GrReferenceExpression)element; } else if (element instanceof GrArgumentList) { PsiElement parent = element.getParent(); if (parent instanceof GrMethodCall) { GrExpression invoked = ((GrMethodCall)parent).getInvokedExpression(); if (invoked instanceof GrReferenceExpression) { return ((GrReferenceExpression)invoked); } } } return null; }