@Nullable
  private static PsiClass findLanguageFileType(PsiClass language, Module module, PsiClass languageFileType) {
    final UExpression associatedFileTypeExpression = getReturnExpression(language, "getAssociatedFileType");
    if (associatedFileTypeExpression != null) {
      return PsiTypesUtil.getPsiClass(associatedFileTypeExpression.getExpressionType());
    }

    final GlobalSearchScope currentModuleScope = GlobalSearchScope.moduleWithDependenciesScope(module);
    PsiClass matchingFileType = findMatchingFileType(languageFileType, language, currentModuleScope);
    if (matchingFileType != null) return matchingFileType;

    return findMatchingFileType(languageFileType, language, language.getUseScope());
  }
@Nullable
  private static PsiClass findLanguageFileType(PsiClass language, Module module, PsiClass languageFileType)