int (@NotNull Project project, @NotNull PsiFile containingFile, @NotNull final PsiMember member, @NotNull SearchScope scope, @NotNull ProgressIndicator progress) { SearchScope searchScope = getSearchScope(project, member, scope); AtomicInteger count = new AtomicInteger(); boolean ok = UnusedSymbolUtil.processUsages(project, containingFile, searchScope, member, progress, null, info -> { PsiFile psiFile = info.getFile(); if (psiFile == null) { return true; } int offset = info.getNavigationOffset(); if (offset == -1) return true; count.incrementAndGet(); return true; }); if (!ok) { return TOO_MANY_USAGES; } return count.get(); }