List<PsiSymbolReference> (@NotNull PsiExternalReferenceHost element, @NotNull PsiSymbolReferenceHints hints) { Supplier<List<PsiSymbolReference>> supplier = () -> { List<PsiSymbolReferenceProviderBean> beans = ReferenceProviders.byLanguage(element.getLanguage()).byHostClass(element.getClass()); if (beans.isEmpty()) { return Collections.emptyList(); } Class<? extends PsiSymbolReference> requiredReferenceClass = hints.getReferenceClass(); List<PsiSymbolReference> result = new SmartList<>(); for (PsiSymbolReferenceProviderBean bean : beans) { if (requiredReferenceClass == PsiSymbolReference.class // top required || bean.anyReferenceClass // bottom provided || requiredReferenceClass.isAssignableFrom(bean.getReferenceClass())) { result.addAll(bean.getInstance().getReferences(element, hints)); } } return Collections.unmodifiableList(result); }; if (hints == EMPTY_HINTS) { return CachedValuesManager.getCachedValue(element, () -> Result.create( supplier.get(), PsiModificationTracker.MODIFICATION_COUNT )); } return supplier.get(); }