コード例 #1
0
  private void updateUnindexedFiles(ProgressIndicator indicator) {
    PerformanceWatcher.Snapshot snapshot = PerformanceWatcher.takeSnapshot();
    PushedFilePropertiesUpdater.getInstance(myProject).pushAllPropertiesNow();
    boolean trackResponsiveness = !ApplicationManager.getApplication().isUnitTestMode();

    if (trackResponsiveness) snapshot.logResponsivenessSinceCreation("Pushing properties");

    indicator.setIndeterminate(true);
    indicator.setText(IdeBundle.message("progress.indexing.scanning"));

    myIndex.clearIndicesIfNecessary();

    CollectingContentIterator finder = myIndex.createContentIterator(indicator);
    snapshot = PerformanceWatcher.takeSnapshot();

    myIndex.iterateIndexableFilesConcurrently(finder, myProject, indicator);

    myIndex.filesUpdateEnumerationFinished();

    if (trackResponsiveness) snapshot.logResponsivenessSinceCreation("Indexable file iteration");

    List<VirtualFile> files = finder.getFiles();

    if (myOnStartup && !ApplicationManager.getApplication().isUnitTestMode()) {
      // full VFS refresh makes sense only after it's loaded, i.e. after scanning files to index is
      // finished
      ((StartupManagerImpl) StartupManager.getInstance(myProject)).scheduleInitialVfsRefresh();
    }

    if (files.isEmpty()) {
      return;
    }

    snapshot = PerformanceWatcher.takeSnapshot();

    if (trackResponsiveness)
      LOG.info("Unindexed files update started: " + files.size() + " files to update");

    indicator.setIndeterminate(false);
    indicator.setText(IdeBundle.message("progress.indexing.updating"));

    indexFiles(indicator, files);

    if (trackResponsiveness) snapshot.logResponsivenessSinceCreation("Unindexed files update");
  }
コード例 #2
0
 private void perform(List<DependenciesBuilder> builders) {
   try {
     PerformanceWatcher.Snapshot snapshot = PerformanceWatcher.takeSnapshot();
     for (AnalysisScope scope : myScopes) {
       builders.add(createDependenciesBuilder(scope));
     }
     for (DependenciesBuilder builder : builders) {
       builder.analyze();
     }
     snapshot.logResponsivenessSinceCreation("Dependency analysis");
   } catch (IndexNotReadyException e) {
     DumbService.getInstance(myProject)
         .showDumbModeNotification(
             "Analyze dependencies is not available until indices are ready");
     throw new ProcessCanceledException();
   }
 }