@Override
  public @Nullable LanguageFileType findFileTypeByLanguage(@NotNull Language language) {
    FileTypeBean bean = withReadLock(() -> {
      for (FileTypeBean b : pendingFileTypes.values()) {
        if (language.getID().equals(b.language)) {
          return b;
        }
      }
      return null;
    });
    if (bean != null) {
      FileTypeWithDescriptor descriptor = instantiateFileTypeBean(bean);
      return descriptor != null ? (LanguageFileType)descriptor.fileType() : null;
    }

    // Do not use getRegisteredFileTypes(), to avoid instantiating all pending file types
    return withReadLock(() -> language.findMyFileType(ContainerUtil.map2Array(getAllFileTypeWithDescriptors(), FileType.EMPTY_ARRAY, ftd-> ftd.fileType())));
  }
@Override
  public @Nullable LanguageFileType findFileTypeByLanguage(@NotNull Language language)