private static @NotNull Map<String, LanguageFileType> getNames2FileTypes() {
    final Map<String, LanguageFileType> names2FileTypes = ourNames2FileTypes;
    if (names2FileTypes != null) {
      return names2FileTypes;
    }

    final FileType[] fileTypes = FileTypeManager.getInstance().getRegisteredFileTypes();
    final Map<String, LanguageFileType> cache = Arrays.stream(fileTypes)
      .filter(fileType -> fileType instanceof LanguageFileType)
      .collect(Collectors.toMap(FileType::getName, fileType -> (LanguageFileType)fileType));
    for (Language language : Language.getRegisteredLanguages()) {
      final LanguageFileType fileType = language.getAssociatedFileType();
      if (fileType != null) {
        cache.put(fileType.getName(), fileType);
      }
    }
    return ourNames2FileTypes = cache;
  }
private static @NotNull Map<String, LanguageFileType> getNames2FileTypes()