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 85077380ea6e..da85132806e5 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java @@ -531,7 +531,8 @@ public class FileBasedIndexImpl extends FileBasedIndex { extension.hasSnapshotMapping() && IdIndex.ourSnapshotMappingsEnabled ? createInputsIndexExternalizer(extension, indexId, extension.getKeyDescriptor()) : null; - index = new MapReduceIndex(indexId, extension.getIndexer(), storage, externalizer, extension.getValueExternalizer()); + index = new MapReduceIndex( + indexId, extension.getIndexer(), storage, externalizer, extension.getValueExternalizer(), extension instanceof PsiDependentIndex); } index.setInputIdToDataKeysIndex(new Factory>>() { @Override diff --git a/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java b/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java index 6427765295c5..0060cb2fb159 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java @@ -17,10 +17,14 @@ package com.intellij.util.indexing; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.util.*; import com.intellij.openapi.util.io.BufferExposingByteArrayOutputStream; import com.intellij.openapi.util.io.ByteSequence; +import com.intellij.psi.PsiDocumentManager; +import com.intellij.psi.PsiFile; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.util.*; import com.intellij.util.io.*; @@ -50,6 +54,7 @@ public class MapReduceIndex implements UpdatableIndex myValueExternalizer; private final DataExternalizer> mySnapshotIndexExternalizer; + private final boolean myIsPsiBackedIndex; private PersistentHashMap> myInputsIndex; private PersistentHashMap myContents; @@ -75,14 +80,16 @@ public class MapReduceIndex implements UpdatableIndex indexId, DataIndexer indexer, @NotNull IndexStorage storage) throws IOException { - this(indexId, indexer, storage, null, null); + this(indexId, indexer, storage, null, null, false); } public MapReduceIndex(@Nullable final ID indexId, DataIndexer indexer, @NotNull IndexStorage storage, DataExternalizer> snapshotIndexExternalizer, - DataExternalizer valueDataExternalizer) throws IOException { + DataExternalizer valueDataExternalizer, + boolean psiBasedIndex + ) throws IOException { myIndexId = indexId; myIndexer = indexer; myStorage = storage; @@ -91,6 +98,7 @@ public class MapReduceIndex implements UpdatableIndex createContentsIndex() throws IOException { @@ -557,7 +565,34 @@ public class MapReduceIndex implements UpdatableIndex implements UpdatableIndex ourSavedContentHashIdKey = com.intellij.openapi.util.Key.create("saved.content.hash.id"); + private static final com.intellij.openapi.util.Key ourSavedUncommittedHashIdKey = com.intellij.openapi.util.Key.create("saved.uncommitted.hash.id"); protected void updateWithMap(final int inputId, int savedInputId, @NotNull Map newData,