private void beforeFileMovement(@NotNull VFileMoveEvent event) {
    VirtualFile vFile = event.getFile();

    PsiDirectory oldParentDir = myFileManager.findDirectory(event.getOldParent());
    PsiDirectory newParentDir = myFileManager.findDirectory(event.getNewParent());
    if ((oldParentDir == null && newParentDir == null) || FileTypeManager.getInstance().isFileIgnored(vFile)) {
      return;
    }

    ApplicationManager.getApplication().runWriteAction((ExternalChangeAction)() -> {
      PsiTreeChangeEventImpl treeEvent = new PsiTreeChangeEventImpl(myManager);

      boolean isExcluded = vFile.isDirectory() &&
                           Registry.is("ide.hide.excluded.files") && myProjectRootManager.getFileIndex().isExcluded(vFile);
      if (oldParentDir != null && !isExcluded) {
        PsiElement eventChild = vFile.isDirectory() ? myFileManager.findDirectory(vFile) : myFileManager.findFile(vFile);
        treeEvent.setChild(eventChild);
        if (newParentDir != null) {
          treeEvent.setOldParent(oldParentDir);
          treeEvent.setNewParent(newParentDir);
          myManager.beforeChildMovement(treeEvent);
        }
        else {
          treeEvent.setParent(oldParentDir);
          myManager.beforeChildRemoval(treeEvent);
        }
      }
      else {
        LOG.assertTrue(newParentDir != null); // checked above
        treeEvent.setParent(newParentDir);
        myManager.beforeChildAddition(treeEvent);
      }
    });
  }
private void beforeFileMovement(@NotNull VFileMoveEvent event)