GroovyResolveResult (final PsiElement ref) { if (ref instanceof GrEnumConstant) return ((GrEnumConstant)ref).advancedResolve(); PsiElement parent = ref.getParent(); if (parent instanceof GrMethodCall) { final GrExpression expression = ((GrMethodCall)parent).getInvokedExpression(); if (expression instanceof GrReferenceExpression) { return ((GrReferenceExpression)expression).advancedResolve(); } } else if (parent instanceof GrConstructorCall) { return ((GrConstructorCall)parent).advancedResolve(); } return null; }