summaryrefslogtreecommitdiff
path: root/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java')
-rw-r--r--platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java31
1 files changed, 10 insertions, 21 deletions
diff --git a/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java b/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java
index 53798fa938ca..87597de332ba 100644
--- a/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java
+++ b/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java
@@ -1,4 +1,4 @@
-// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
+// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.indexing;
import com.intellij.diagnostic.PerformanceWatcher;
@@ -36,7 +36,6 @@ import com.intellij.util.indexing.contentQueue.IndexUpdateRunner;
import com.intellij.util.indexing.diagnostic.IndexDiagnosticDumper;
import com.intellij.util.indexing.diagnostic.ProjectIndexingHistoryImpl;
import com.intellij.util.indexing.diagnostic.ScanningStatistics;
-import com.intellij.util.indexing.diagnostic.ScanningType;
import com.intellij.util.indexing.diagnostic.dto.JsonScanningStatistics;
import com.intellij.util.indexing.roots.IndexableFileScanner;
import com.intellij.util.indexing.roots.IndexableFilesDeduplicateFilter;
@@ -86,7 +85,6 @@ public class UnindexedFilesUpdater extends DumbModeTask {
private final boolean myStartSuspended;
private final boolean myOnProjectOpen;
private final @NonNls String myIndexingReason;
- private final @NotNull ScanningType myScanningType;
private final PushedFilePropertiesUpdater myPusher;
private final @Nullable List<IndexableFilesIterator> myPredefinedIndexableFilesIterators;
@@ -94,13 +92,11 @@ public class UnindexedFilesUpdater extends DumbModeTask {
boolean startSuspended,
boolean onProjectOpen,
@Nullable List<IndexableFilesIterator> predefinedIndexableFilesIterators,
- @Nullable @NonNls String indexingReason,
- @NotNull ScanningType scanningType) {
+ @Nullable @NonNls String indexingReason) {
myProject = project;
myStartSuspended = startSuspended;
myOnProjectOpen = onProjectOpen;
myIndexingReason = indexingReason;
- myScanningType = scanningType;
myPusher = PushedFilePropertiesUpdater.getInstance(myProject);
myPredefinedIndexableFilesIterators = predefinedIndexableFilesIterators;
@@ -160,8 +156,7 @@ public class UnindexedFilesUpdater extends DumbModeTask {
myStartSuspended,
false,
mergeIterators(myPredefinedIndexableFilesIterators, ((UnindexedFilesUpdater)taskFromQueue).myPredefinedIndexableFilesIterators),
- reason,
- ScanningType.Companion.merge(oldTask.myScanningType, oldTask.myScanningType)
+ reason
);
}
@@ -182,18 +177,17 @@ public class UnindexedFilesUpdater extends DumbModeTask {
// If we haven't succeeded to fully scan the project content yet, then we must keep trying to run
// file based index extensions for all project files until at least one of UnindexedFilesUpdater-s finishes without cancellation.
// This is important, for example, for shared indexes: all files must be associated with their locally available shared index chunks.
- this(project, false, false, null, null, ScanningType.FULL);
+ this(project, false, false, null, null);
}
public UnindexedFilesUpdater(@NotNull Project project, @Nullable @NonNls String indexingReason) {
- this(project, false, false, null, indexingReason, ScanningType.FULL);
+ this(project, false, false, null, indexingReason);
}
public UnindexedFilesUpdater(@NotNull Project project,
@Nullable List<IndexableFilesIterator> predefinedIndexableFilesIterators,
@Nullable @NonNls String indexingReason) {
- this(project, false, false, predefinedIndexableFilesIterators, indexingReason,
- predefinedIndexableFilesIterators == null ? ScanningType.FULL : ScanningType.PARTIAL);
+ this(project, false, false, predefinedIndexableFilesIterators, indexingReason);
}
private void updateUnindexedFiles(@NotNull ProjectIndexingHistoryImpl projectIndexingHistory, @NotNull ProgressIndicator indicator) {
@@ -579,8 +573,7 @@ public class UnindexedFilesUpdater extends DumbModeTask {
}
protected @NotNull ProjectIndexingHistoryImpl performScanningAndIndexing(@NotNull ProgressIndicator indicator) {
- ProjectIndexingHistoryImpl projectIndexingHistory =
- new ProjectIndexingHistoryImpl(myProject, myIndexingReason, myScanningType);
+ ProjectIndexingHistoryImpl projectIndexingHistory = new ProjectIndexingHistoryImpl(myProject, myIndexingReason, isFullIndexUpdate());
myIndex.loadIndexes();
myIndex.filesUpdateStarted(myProject, isFullIndexUpdate());
IndexDiagnosticDumper.getInstance().onIndexingStarted(projectIndexingHistory);
@@ -650,21 +643,17 @@ public class UnindexedFilesUpdater extends DumbModeTask {
return SystemProperties.getBooleanProperty("ij.indexes.skip.initial.refresh", false);
}
- public static void scanAndIndexProjectAfterOpen(@NotNull Project project,
- boolean startSuspended,
- @Nullable @NonNls String indexingReason) {
+ public static void scanAndIndexProjectAfterOpen(@NotNull Project project, boolean startSuspended, @Nullable @NonNls String indexingReason) {
if (TestModeFlags.is(INDEX_PROJECT_WITH_MANY_UPDATERS_TEST_KEY)) {
LOG.assertTrue(ApplicationManager.getApplication().isUnitTestMode());
List<IndexableFilesIterator> iterators = collectProviders(project, (FileBasedIndexImpl)FileBasedIndex.getInstance());
for (IndexableFilesIterator iterator : iterators) {
- new UnindexedFilesUpdater(project, startSuspended, true, Collections.singletonList(iterator), indexingReason,
- ScanningType.FULL_ON_PROJECT_OPEN).queue(project);
+ new UnindexedFilesUpdater(project, startSuspended, true, Collections.singletonList(iterator), indexingReason).queue(project);
}
project.putUserData(CONTENT_SCANNED, true);
}
else {
- new UnindexedFilesUpdater(project, startSuspended, true, null, indexingReason, ScanningType.FULL_ON_PROJECT_OPEN).
- queue(project);
+ new UnindexedFilesUpdater(project, startSuspended, true, null, indexingReason).queue(project);
}
}
}