void (UsageInfo @NotNull [] usages, @NotNull Map<PsiElement, PsiElement> oldToNewMap) { for (UsageInfo usageInfo : usages) { if (usageInfo instanceof MyUsageInfo info) { PsiElement element = info.myTarget; if (info.getReference() instanceof FileReference || info.getReference() instanceof PsiDynaReference) { final PsiElement usageElement = info.getElement(); if (usageElement != null) { final PsiFile usageFile = usageElement.getContainingFile(); final PsiFile psiFile = usageFile.getViewProvider().getPsi(usageFile.getViewProvider().getBaseLanguage()); if (psiFile != null && psiFile.equals(element)) { continue; // already processed in MoveFilesOrDirectoriesUtil.doMoveFile } } } final PsiElement refElement = info.myReference.getElement(); if (refElement.isValid()) { info.myReference.bindToElement(element); } } } }