From 5beacf0b13df15afaed9b18933e0f6cc79c5dc30 Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Wed, 13 Apr 2016 12:10:33 +0200 Subject: [PATCH] contentsChanged event for file outside indexablesets doesn't add the file for filesToBeIndexed --- .../util/indexing/FileBasedIndexImpl.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java index e7682bc88d34..fc5d7f81bc97 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java @@ -1791,8 +1791,8 @@ public class FileBasedIndexImpl extends FileBasedIndex { clearUpToDateStateForPsiIndicesOfUnsavedDocuments(file); - // the file is for sure not a dir and it was previously indexed by at least one index AND it belongs to some update set - if (!isTooLarge(file) && getIndexableSetForFile(file) != null) myChangedFilesCollector.scheduleForUpdate(file); + // the file is for sure not a dir and it was previously indexed by at least one index + if (!isTooLarge(file)) myChangedFilesCollector.scheduleForUpdate(file); } } else if (!fileIndexedStatesToUpdate.isEmpty()) { // file was removed, its data should be (lazily) wiped for every index @@ -1854,10 +1854,10 @@ public class FileBasedIndexImpl extends FileBasedIndex { } } - if (scheduleForUpdate) { - if (resetStamp) IndexingStamp.flushCache(fileId); - myChangedFilesCollector.scheduleForUpdate(file); - } + if (scheduleForUpdate) { + if (resetStamp) IndexingStamp.flushCache(fileId); + myChangedFilesCollector.scheduleForUpdate(file); + } if (!myUpToDateIndicesForUnsavedOrTransactedDocuments.isEmpty()) { clearUpToDateStateForPsiIndicesOfUnsavedDocuments(file); @@ -1922,6 +1922,12 @@ public class FileBasedIndexImpl extends FileBasedIndex { } void scheduleForUpdate(VirtualFile file) { + if (!(file instanceof DeletedVirtualFileStub)) { + IndexableFileSet setForFile = getIndexableSetForFile(file); + if (setForFile == null) { + return; + } + } final int fileId = Math.abs(getIdMaskingNonIdBasedFile(file)); final VirtualFile previousVirtualFile = myFilesToUpdate.put(fileId, file);