From 2a241cb4bcb8d3fc69b41a7efc703dc87381b111 Mon Sep 17 00:00:00 2001 From: Eugene Petrenko Date: Tue, 2 Jun 2020 23:16:06 +0200 Subject: [PATCH] shared-indexes: do not terminate Shared Indexes chunks download if indexing is restarted GitOrigin-RevId: 5b8f6fad3d51634bb4b9e6de0dfc2bee2c687b6d --- .../indexing/FileBasedIndexInfrastructureExtension.java | 6 +++++- .../com/intellij/util/indexing/UnindexedFilesUpdater.java | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexInfrastructureExtension.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexInfrastructureExtension.java index b24a0ad5c723..a865a5b86ce4 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexInfrastructureExtension.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexInfrastructureExtension.java @@ -14,7 +14,7 @@ import java.io.IOException; @ApiStatus.Internal public interface FileBasedIndexInfrastructureExtension { - ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.fileBasedIndexInfrastructureExtension"); + ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.fileBasedIndexInfrastructureExtension"); /** * This notification is sent from the IDE to let the extension point implementation @@ -24,6 +24,10 @@ public interface FileBasedIndexInfrastructureExtension { */ void processIndexingProject(@NotNull Project project, @NotNull ProgressIndicator indexingIndicator); + /** + * This notification is sent when the indexing is started and there are no files detected to index + */ + void noFilesFoundToProcessIndexingProject(@NotNull Project project, @NotNull ProgressIndicator indexingIndicator); interface FileIndexingStatusProcessor { /** 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 cec66784e474..9a695c5493f4 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java @@ -132,6 +132,7 @@ public final class UnindexedFilesUpdater extends DumbModeTask { } if (totalFiles == 0 || SystemProperties.getBooleanProperty("idea.indexes.pretendNoFiles", false)) { + FileBasedIndexInfrastructureExtension.EP_NAME.extensions().forEach(ex -> ex.noFilesFoundToProcessIndexingProject(myProject, indicator)); return; }