@Override
  public @NotNull FileType getFileTypeByFile(@NotNull VirtualFile file, byte @Nullable [] content) {
    FileType temporarilyFixedFileType = getTemporarilyFixedFileType(file);
    if (temporarilyFixedFileType != null) return temporarilyFixedFileType;

    FileType overriddenFileType = FileTypeOverrider.EP_NAME.computeSafeIfAny(overrider -> overrider.getOverriddenFileType(file));
    if (overriddenFileType != null) {
      return overriddenFileType;
    }

    FileType fileType = getByFile(file);
    if (file instanceof StubVirtualFile) {
      if (fileType == null && content == null && file instanceof FakeVirtualFile) {
        if (ScratchUtil.isScratch(file.getParent())) return PlainTextFileType.INSTANCE;
      }
    }
    else if (fileType == null || fileType == DetectedByContentFileType.INSTANCE) {
      fileType = internalContinueToDetectFileTypeByFile(file, content, fileType);
    }
    FileType result = fileType == null ? UnknownFileType.INSTANCE : fileType;
    CachedFileTypes cached = CACHED;
    if (cached != null && file instanceof VirtualFileWithId vfid) {
      cached.fileTypes().put(vfid.getId(), result);
    }
    return result;
  }
@Override
  public @NotNull FileType getFileTypeByFile(@NotNull VirtualFile file, byte @Nullable [] content)