use of com.intellij.openapi.roots.CollectingContentIterator in project intellij-community by JetBrains.
the class UnindexedFilesUpdater method updateUnindexedFiles.
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 (!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");
}
Aggregations