@SuppressWarnings("DanglingJavadoc")
  @Nullable FileType getByFile(@NotNull VirtualFile file) {
    FileType temporarilyFixedFileType = getTemporarilyFixedFileType(file);
    if (temporarilyFixedFileType != null) return temporarilyFixedFileType;

    if (file instanceof VirtualFileWithAssignedFileType) {
      FileType fileType = ((VirtualFileWithAssignedFileType)file).getAssignedFileType();
      if (fileType != null) {
        return fileType;
      }
    }

    for (FileTypeIdentifiableByVirtualFile specialType : specialFileTypes) {
      if (specialType.isMyFileType(file)) {
        if (toLog()) {
          log("getByFile(" + file.getName() + "): Special file type: " + specialType.getName());
        }
        return specialType;
      }
    }

    FileType fileType = getFileTypeByFileName(file.getNameSequence());
    if (fileType == UnknownFileType.INSTANCE) {
      /**
        {@link DetectedByContentFileType} is a special SpecialFileType (and not actual {@link FileTypeIdentifiableByVirtualFile} at that):
        Its {@link DetectedByContentFileType#isMyFileType(VirtualFile)} has to be called after all other {@link FileTypeIdentifiableByVirtualFile#isMyFileType(VirtualFile)}
        to avoid (mis)detecting some empty special file as DetectedByContentFileType
       */
      if (DetectedByContentFileType.isMyFileType(file)) {
        return DetectedByContentFileType.INSTANCE;
      }
      fileType = null;
    }
    if (toLog()) {
      log("F: getByFile(" + file.getName() + ") By name file type: "+(fileType == null ? null : fileType.getName()));
    }
    return fileType;
  }
@SuppressWarnings("DanglingJavadoc")
  @Nullable FileType getByFile(@NotNull VirtualFile file)