void (int fileId, @NotNull VirtualFile file, @NotNull String cause) { VfsEventsMerger.tryLog("REMOVE", file, () -> { return "cause=" + cause; }); VirtualFile originalFile = file instanceof DeletedVirtualFileStub ? ((DeletedVirtualFileStub)file).getOriginalFile() : file; final List<ID<?, ?>> states = IndexingStamp.getNontrivialFileIndexedStates(fileId); cleanProcessingFlag(fileId); if (!states.isEmpty()) { ProgressManager.getInstance().executeNonCancelableSection(() -> removeFileDataFromIndices(states, fileId, originalFile)); } boolean isValid = file instanceof DeletedVirtualFileStub ? ((DeletedVirtualFileStub)file).isOriginalValid() : file.isValid(); if (!isValid) { getIndexableFilesFilterHolder().removeFile(fileId); } }