LanguageDefinition (@NotNull PsiClass language, List<? extends LanguageDefinition> libraryLanguages) { if (language.hasModifierProperty(PsiModifier.ABSTRACT)) { return null; } if (ContainerUtil.exists(libraryLanguages, definition -> definition.clazz.equals(language))) { return null; } return CachedValuesManager.getCachedValue(language, () -> { String languageId = computeConstantSuperCtorCallParameter(language, 0); if (languageId == null) { languageId = computeConstantSuperCtorCallParameter(language, 1); } if (languageId == null) { languageId = computeConstantReturnValue(language, "getID"); } if (StringUtil.isEmpty(languageId)) { return Result.create(null, language); } LanguageDefinition definition = new LanguageDefinition(languageId, language, () -> computeIconForProjectLanguage(language), () -> computeConstantReturnValue(language, "getDisplayName")); return Result.createSingleDependency(definition, language); }); }