void (PsiJavaFile psiFile, PsiField psiField, PsiClass containingClass, String fieldName, PsiElement reference, Project project) { if (reference instanceof PsiReferenceExpression ref) { PsiImportList importList = psiFile.getImportList(); if (importList != null) { PsiReferenceExpressionImpl.bindToElementViaStaticImport(containingClass, fieldName, importList); final PsiElement qualifier = ref.getQualifier(); if (qualifier != null) { final Boolean canRemoveQualifier = qualifier.getCopyableUserData(ChangeContextUtil.CAN_REMOVE_QUALIFIER_KEY); if (canRemoveQualifier != null && canRemoveQualifier.booleanValue()) { qualifier.delete(); } else { final PsiJavaCodeReferenceElement classReferenceElement = JavaPsiFacade.getElementFactory(project).createReferenceExpression(containingClass); qualifier.replace(classReferenceElement); } } } } else if (reference instanceof PsiDocMethodOrFieldRef){ Objects.requireNonNull(reference.getReference()).bindToElement(psiField); //todo refs through inheritors } }