void (@NotNull Project project, PsiElement @NotNull [] elements, DataContext dataContext) { final PsiElement targetContainer = dataContext == null ? null : LangDataKeys.TARGET_PSI_ELEMENT.getData(dataContext); final Set<PsiElement> filesOrDirs = new HashSet<>(); if (!DumbService.isDumb(project)) { for (MoveHandlerDelegate delegate : MoveHandlerDelegate.EP_NAME.getExtensionList()) { if (delegate.canMove(dataContext) && delegate.isValidTarget(targetContainer, elements)) { delegate.collectFilesOrDirsFromContext(dataContext, filesOrDirs); } } } if (!filesOrDirs.isEmpty()) { for (PsiElement element : elements) { if (element instanceof PsiDirectory) { filesOrDirs.add(element); } else { final PsiFile containingFile = element.getContainingFile(); if (containingFile != null) { filesOrDirs.add(containingFile); } } } MoveUsagesCollector.MOVE_FILES_OR_DIRECTORIES.log(project); MoveFilesOrDirectoriesUtil .doMove(project, PsiUtilCore.toPsiElementArray(filesOrDirs), new PsiElement[]{targetContainer}, null); return; } doMove(project, elements, targetContainer, dataContext, null); }