public static boolean isJsonFile(@NotNull VirtualFile file, @Nullable Project project) {
    FileType type = file.getFileType();
    if (type instanceof LanguageFileType && ((LanguageFileType)type).getLanguage() instanceof JsonLanguage) return true;
    if (project == null || !ScratchUtil.isScratch(file)) return false;
    RootType rootType = ScratchFileService.findRootType(file);
    return rootType != null && rootType.substituteLanguage(project, file) instanceof JsonLanguage;
  }
public static boolean isJsonFile(@NotNull VirtualFile file, @Nullable Project project)