ItemWithPresentation (final PsiElement element) { if (ArrayUtil.find(targets, element) > -1) return null; if (!hasDifferentNames && element instanceof PsiNamedElement) { final String name = ReadAction.compute(() -> ((PsiNamedElement)element).getName()); myNames.add(name); hasDifferentNames = myNames.size() > 1; if (hasDifferentNames) { for (ItemWithPresentation item : myItems) { if (item.getItem() instanceof Pointer<?>) { ReadAction.run(() -> { Object o = ((Pointer<?>)item.getItem()).dereference(); if (o instanceof PsiElement) { item.setPresentation(computePresentation((PsiElement)o, hasDifferentNames)); } }); } } } } targets = ArrayUtil.append(targets, element); return initPresentation(element, hasDifferentNames); }