id index should be psi dependent

GitOrigin-RevId: cabd8c125940674d2b6c2a330134fa52061b290d
This commit is contained in:
Dmitry Batkovich
2020-06-16 16:21:43 +03:00
committed by intellij-monorepo-bot
parent fa78a2a4c7
commit 9930641b54
2 changed files with 5 additions and 3 deletions
@@ -29,7 +29,7 @@ import java.util.Map;
* Consider usage of {@link com.intellij.psi.search.PsiSearchHelper} or {@link com.intellij.psi.impl.cache.CacheManager} instead direct index access.
*/
@ApiStatus.Internal
public class IdIndex extends FileBasedIndexExtension<IdIndexEntry, Integer> implements DocumentChangeDependentIndex {
public class IdIndex extends FileBasedIndexExtension<IdIndexEntry, Integer> {
@NonNls public static final ID<IdIndexEntry, Integer> NAME = ID.create("IdIndex");
private final KeyDescriptor<IdIndexEntry> myKeyDescriptor = new InlineKeyDescriptor<IdIndexEntry>() {
@@ -1381,7 +1381,9 @@ public final class FileBasedIndexImpl extends FileBasedIndexEx {
if (myStorageBufferingHandler.runUpdate(false, storageUpdate)) {
ConcurrencyUtil.withLock(myReadLock, () -> {
if (currentFC != null) {
index.setIndexedStateForFile(inputId, currentFC);
if (!isMock(currentFC.getFile())) {
index.setIndexedStateForFile(inputId, currentFC);
}
}
else {
index.resetIndexedStateForFile(inputId);
@@ -1681,7 +1683,7 @@ public final class FileBasedIndexImpl extends FileBasedIndexEx {
if (file != null) {
VirtualFile virtualFile = file.getVirtualFile();
if (virtualFile instanceof VirtualFileWithId) {
if (virtualFile instanceof VirtualFileWithId && !isMock(virtualFile)) {
getChangedFilesCollector().getEventMerger().recordTransientStateChangeEvent(virtualFile);
}
}