boolean (@NotNull Project project, @NotNull VirtualFile file) { String fileName = file.getName(); if (PathUtilRt.getFileExtension(fileName) == null) return false; boolean caseSensitive = file.isCaseSensitive(); FileTypeManager fileTypeManager = FileTypeManager.getInstance(); FileType expected = getFileTypeFromName(fileName, fileTypeManager); Language language = LanguageUtil.getLanguageForPsi(project, file); FileType actual = language == null ? null : language.getAssociatedFileType(); if (actual == null) return expected != null; if (expected == actual) return true; return getFileTypeExtensions(actual, false, fileTypeManager) .filter(o -> hasExtension(fileName, o, caseSensitive)) .isNotEmpty(); }