void (@NotNull final PsiMember usage, final Processor<? super PsiReference> processor, final PsiMethod constructor) { if (constructor instanceof GrMethod) { GrParameter[] grParameters = (GrParameter[])constructor.getParameterList().getParameters(); if (grParameters.length > 0 && !grParameters[0].isOptional()) return; } else if (!constructor.getParameterList().isEmpty()) return; PsiManager manager = constructor.getManager(); if (manager.areElementsEquivalent(usage, constructor) || manager.areElementsEquivalent(constructor.getContainingClass(), usage.getContainingClass())) return; processor.process(new LightMemberReference(manager, usage, PsiSubstitutor.EMPTY) { @NotNull @Override public PsiElement getElement() { return usage; } @NotNull @Override public TextRange getRangeInElement() { if (usage instanceof PsiClass) { PsiIdentifier identifier = ((PsiClass)usage).getNameIdentifier(); if (identifier != null) return TextRange.from(identifier.getStartOffsetInParent(), identifier.getTextLength()); } else if (usage instanceof PsiMethod) { PsiIdentifier identifier = ((PsiMethod)usage).getNameIdentifier(); if (identifier != null) return TextRange.from(identifier.getStartOffsetInParent(), identifier.getTextLength()); } return super.getRangeInElement(); } }); }