boolean (@NotNull final PsiMember usage, @NotNull final Processor<? super PsiReference> processor, @NotNull final PsiMethod constructor, @NotNull final Project project, @NotNull final PsiClass containingClass) { if (containingClass instanceof PsiAnonymousClass) return true; PsiClass ctrClass = constructor.getContainingClass(); if (ctrClass == null) return true; boolean isImplicitSuper = DumbService.getInstance(project).runReadActionInSmartMode( () -> myManager.areElementsEquivalent(ctrClass, containingClass.getSuperClass())); if (!isImplicitSuper) { return true; } PsiElement resolved = JavaResolveUtil.resolveImaginarySuperCallInThisPlace(usage, project, ctrClass); boolean resolvesToThisConstructor = DumbService.getInstance(project).runReadActionInSmartMode( () -> myManager.areElementsEquivalent(constructor, resolved)); if (!resolvesToThisConstructor) { return true; } return processor.process(new LightMemberReference(myManager, usage, PsiSubstitutor.EMPTY) { @NotNull @Override public PsiElement getElement() { return usage; } @NotNull @Override public TextRange getRangeInElement() { if (usage instanceof PsiNameIdentifierOwner) { PsiElement identifier = ((PsiNameIdentifierOwner)usage).getNameIdentifier(); if (identifier != null) { final int startOffsetInParent = identifier.getStartOffsetInParent(); if (startOffsetInParent >= 0) { // -1 for light elements generated e.g. by lombok return TextRange.from(startOffsetInParent, identifier.getTextLength()); } else { return new UnfairTextRange(-1, -1); } } } return super.getRangeInElement(); } }); }