private static @NotNull List<IdeDocumentHistoryImpl.PlaceInfo> getPlaces(@NotNull Project project, boolean changed) {
      String path = ScratchFileService.getInstance().getRootPath(ScratchRootType.getInstance());
      VirtualFile rootDir = LocalFileSystem.getInstance().findFileByPath(path);
      if (rootDir == null || !rootDir.exists() || !rootDir.isDirectory()) return Collections.emptyList();
      Condition<? super VirtualFile> condition;
      if (!changed) {
        condition = Conditions.alwaysTrue();
      }
      else {
        Set<VirtualFile> files = JBIterable.from(IdeDocumentHistory.getInstance(project).getChangePlaces())
          .map(o -> o.getFile()).toSet();
        condition = files::contains;
      }
      List<IdeDocumentHistoryImpl.PlaceInfo> result = new ArrayList<>();
      VfsUtilCore.visitChildrenRecursively(rootDir, new VirtualFileVisitor<>(VirtualFileVisitor.SKIP_ROOT) {
        @Override
        public boolean visitFile(@NotNull VirtualFile file) {
          if (file.isDirectory() || !file.isValid() || !condition.value(file)) return true;
          Document document = FileDocumentManager.getInstance().getDocument(file);
          if (document == null) return true;
          RangeMarker caret = document.createRangeMarker(0, 0);
          result.add(new IdeDocumentHistoryImpl.PlaceInfo(file, new TextEditorState(), "text-editor", null, caret));
          return result.size() < 1000;
        }
      });
      Collections.sort(result, Comparator.comparing(o -> o.getFile().getName(), NaturalComparator.INSTANCE));
      return result;
    }
private static @NotNull List<IdeDocumentHistoryImpl.PlaceInfo> getPlaces(@NotNull Project project, boolean changed)