void (@NotNull VirtualFile vFile, @NotNull Set<VirtualFile> detectorCalled) { PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); log("T: ensureReDetected: commit. re-detect queue: " + myFileTypeManager.dumpReDetectQueue()); UIUtil.dispatchAllInvocationEvents(); log("T: ensureReDetected: dispatch. re-detect queue: " + myFileTypeManager.dumpReDetectQueue()); myFileTypeManager.drainReDetectQueue(); log("T: ensureReDetected: drain. re-detect queue: " + myFileTypeManager.dumpReDetectQueue()); UIUtil.dispatchAllInvocationEvents(); log("T: ensureReDetected: dispatch. re-detect queue: " + myFileTypeManager.dumpReDetectQueue()); FileType type = getFileType(vFile); log("T: ensureReDetected: getFileType (" + type.getName() + ") re-detect queue: " + myFileTypeManager.dumpReDetectQueue()); assertTrue(detectorCalled.contains(vFile)); detectorCalled.clear(); log("T: ensureReDetected: clear"); }