void (@NotNull List<? extends Pair<String, String>> entries, @NotNull Context context, @NotNull Runnable runNext) { String root = context.directory == null || context.directoryName == null ? null : context.directory.getPath() + "/" + context.directoryName; for (Pair<String, String> entry : entries) { if ("project".equals(entry.getFirst())) { String path = root == null ? entry.getSecond() : (root + "/" + entry.getSecond()); context.project = ProjectUtil.openProject(Paths.get(path), OpenProjectTask.build().withProjectToClose(null)); if (context.project != null) { runNext.run(); } return; } } // no "project" entry VirtualFile dir = LocalFileSystem.getInstance().refreshAndFindFileByPath(root); if (dir != null) { Project project = PlatformProjectOpenProcessor.getInstance().doOpenProject(dir, null, false); if (project != null) { runNext.run(); } } }