@Override
      public void visitCodeReferenceElement(@NotNull GrCodeReferenceElement refElement) {
        GroovyResolveResult resolveResult = refElement.advancedResolve();
        if (refElement.getReferenceName() == null) return;

        if (PsiTreeUtil.getParentOfType(refElement, GroovyDocPsiElement.class, true, GrMember.class, GrCodeBlock.class) == null) return;

        final PsiElement resolved = resolveResult.getElement();
        if (resolved != null) return;

        final PsiElement toHighlight = refElement.getReferenceNameElement();

        registerError(toHighlight, GroovyBundle.message("cannot.resolve", refElement.getReferenceName()));
      }
@Override
      public void visitCodeReferenceElement(@NotNull GrCodeReferenceElement refElement)