void (int fileId, @NotNull VirtualFile file) { clearUpToDateIndexesForUnsavedOrTransactedDocs(); Document document = myFileDocumentManager.getCachedDocument(file); if (document != null && myFileDocumentManager.isDocumentUnsaved(document)) { // will be reindexed in indexUnsavedDocuments myLastIndexedDocStamps.clearForDocument(document); // Q: non psi indices document.putUserData(ourFileContentKey, null); return; } Collection<ID<?, ?>> contentDependentIndexes = ContainerUtil.intersection(IndexingStamp.getNontrivialFileIndexedStates(fileId), myRegisteredIndexes.getRequiringContentIndices()); removeTransientFileDataFromIndices(contentDependentIndexes, fileId, file); for (ID<?, ?> candidate : contentDependentIndexes) { getIndex(candidate).invalidateIndexedStateForFile(fileId); } IndexingStamp.flushCache(fileId); getChangedFilesCollector().scheduleForUpdate(file); }