private static void collectFiles(Project project, @NotNull VirtualFile file, Set<VirtualFile> result) {
    ProgressManager.checkCanceled();
    if (!result.add(file)) {
      return;
    }

    for (String id : getDependencies(project, file)) {
      for (VirtualFile dep : PluginIdModuleIndex.getFiles(project, id)) {
        collectFiles(project, dep, result);
      }
    }
  }
private static void collectFiles(Project project, @NotNull VirtualFile file, Set<VirtualFile> result)