void (@NotNull Project project, @NotNull final VirtualFile file, @NotNull final VirtualFile newParent) { // Workaround for IDEA-182560, try to wait until ongoing refreshes are finished VfsUtil.markDirty(true, true, file); var semaphore = new Semaphore(1); LocalFileSystem.getInstance().refreshFiles(List.of(file), true, true, () -> semaphore.up()); semaphore.waitFor(); try { WriteCommandAction.writeCommandAction(project) .withName("VcsTestUtil MoveFileInCommand") //NON-NLS .run(() -> file.move(file, newParent)); } catch (IOException e) { throw new RuntimeException(e); } }