List<PsiReference> (@NotNull PsiElement element) { PsiReferenceService referenceService = PsiReferenceService.getService(); List<PsiReference> psiReferences = referenceService.getReferences(element, PsiReferenceService.Hints.NO_HINTS); if (myRefsResolvedCache.containsKey(element)) return psiReferences; PsiElement[] cache = new PsiElement[psiReferences.size()]; for (int i = 0; i < psiReferences.size(); i++) { PsiReference reference = psiReferences.get(i); PsiElement resolveResult; if (reference instanceof PsiPolyVariantReference) { ResolveResult[] results = ((PsiPolyVariantReference)reference).multiResolve(true); resolveResult = results.length == 0 ? null : results[0].getElement(); } else { resolveResult = reference.resolve(); } cache[i] = resolveResult; } myRefsResolvedCache.put(element, cache); return psiReferences; }