PsiJavaCodeReferenceElement () { final GroovyResolveResult resolveResult = myRef.advancedResolve(); final PsiElement resolved = resolveResult.getElement(); if (resolved instanceof PsiClass) { return new LightClassReference(getManager(), getClassReference().getText(), (PsiClass)resolved, resolveResult.getSubstitutor()); } else { return null; } }