void (@NotNull PsiJavaCodeReferenceElement reference) { super.visitReferenceElement(reference); PsiElement resolve = reference.resolve(); if (resolve instanceof PsiClass base) { PsiClass baseClass = base.getContainingClass(); if (baseClass != null && base.hasModifierProperty(PsiModifier.PRIVATE) && baseClass == containerClass && baseClass.getContainingClass() == null) { String description = JavaErrorBundle.message("private.symbol", HighlightUtil.formatClass(base), HighlightUtil.formatClass(baseClass)); HighlightInfo.Builder info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR) .range(extendRef) .descriptionAndTooltip(description); IntentionAction action1 = QuickFixFactory.getInstance().createModifierListFix(base, PsiModifier.PUBLIC, true, false); info.registerFix(action1, null, null, null, null); IntentionAction action = QuickFixFactory.getInstance().createModifierListFix(base, PsiModifier.PROTECTED, true, false); info.registerFix(action, null, null, null, null); infos[0] = info; return; } // must be inner class if (!PsiUtil.isInnerClass(base)) return; if (resolve == resolved && baseClass != null && (!PsiTreeUtil.isAncestor(baseClass, extendRef, true) || aClass.hasModifierProperty(PsiModifier.STATIC)) && !InheritanceUtil.hasEnclosingInstanceInScope(baseClass, extendRef, psiClass -> psiClass != aClass, true) && !qualifiedNewCalledInConstructors(aClass)) { String description = JavaErrorBundle.message("no.enclosing.instance.in.scope", HighlightUtil.formatClass(baseClass)); infos[0] = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(extendRef).descriptionAndTooltip(description); } } }