void (@NotNull PsiReferenceExpression expression) { super.visitReferenceExpression(expression); if (expression.getQualifierExpression() != null) { return; } final PsiElement expressionTarget = expression.resolve(); if (!(expressionTarget instanceof PsiMember member)) { return; } final PsiClass containingClass = member.getContainingClass(); if (!InheritanceUtil.isInheritorOrSelf(target, containingClass, true)) { return; } final PsiExpression newExpression = factory.createExpressionFromText(qualifierText + '.' + expression.getText(), expression); expression.replace(newExpression); }