void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { final PsiElement parent = element.getParent(); if (!(parent instanceof PsiJavaCodeReferenceElement referenceElement)) { return; } final PsiElement target = referenceElement.resolve(); if (!(target instanceof PsiClass aClass)) { return; } ImportUtils.addImportIfNeeded(aClass, element); final String shortName = aClass.getName(); if (isReferenceToTarget(shortName, aClass, parent)) { new CommentTracker().deleteAndRestoreComments(element); } }