boolean (PsiMember member, GlobalSearchScope scope) { final String name = member.getName(); if (name == null) return false; final Project project = member.getProject(); final PsiSearchHelper searchHelper = PsiSearchHelper.getInstance(project); final PsiSearchHelper.SearchCostResult searchCost = searchHelper.isCheapEnoughToSearch(name, scope, null, null); if (searchCost == PsiSearchHelper.SearchCostResult.FEW_OCCURRENCES) { final Query<PsiReference> query = ReferencesSearch.search(member, scope); return query.findFirst() != null; } return false; }