TextRange (@NotNull PsiElement declaredElement, @NotNull PsiElement declaringElement) { PsiElement identifyingElement = getIdentifyingElement(declaredElement); if (identifyingElement == null) { return rangeOf(declaringElement); } TextRange identifyingRange = relateRange(identifyingElement, rangeOf(identifyingElement), declaringElement); if (identifyingRange == null) { return rangeOf(declaringElement); } return identifyingRange; }