FileType (@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); } return ObjectUtils.notNull(fileType, UnknownFileType.INSTANCE); }