boolean (@NotNull PsiElement property, @NotNull String name, @NotNull PsiSearchHelper psiSearchHelper, @NotNull GlobalSearchScope searchScope, boolean onTheFly, @Nullable ProgressIndicator indicator) { GlobalSearchScope exceptPropertyFiles = createExceptPropertyFilesScope(searchScope); GlobalSearchScope newScope = searchScope.intersectWith(exceptPropertyFiles); if (onTheFly) { PsiSearchHelper.SearchCostResult cheapEnough = psiSearchHelper.isCheapEnoughToSearch(name, newScope, null, indicator); if (cheapEnough == PsiSearchHelper.SearchCostResult.ZERO_OCCURRENCES) return false; if (cheapEnough == PsiSearchHelper.SearchCostResult.TOO_MANY_OCCURRENCES) return true; } return ReferencesSearch.search(property, newScope, false).findFirst() != null; }