public boolean processElementUsages(final @NotNull PsiElement element,
                                      final @NotNull Processor<? super UsageInfo> processor,
                                      final @NotNull FindUsagesOptions options) {
    final ReadActionProcessor<PsiReference> refProcessor = new ReadActionProcessor<>() {
      @Override
      public boolean processInReadAction(final PsiReference ref) {
        return processor.process(new UsageInfo(ref));
      }
    };

    final SearchScope scope = options.searchScope;

    final boolean searchText = options.isSearchForTextOccurrences && scope instanceof GlobalSearchScope;

    if (options.isUsages) {
      boolean success =
        ReferencesSearch.search(createSearchParameters(element, scope, options)).forEach(refProcessor);
      if (!success) return false;
    }

    if (searchText) {
      if (options.fastTrack != null) {
        options.fastTrack.searchCustom(consumer -> processUsagesInText(element, processor, (GlobalSearchScope)scope));
      }
      else {
        return processUsagesInText(element, processor, (GlobalSearchScope)scope);
      }
    }
    return true;
  }
public boolean processElementUsages(final @NotNull PsiElement element,
                                      final @NotNull Processor<? super UsageInfo> processor,
                                      final @NotNull FindUsagesOptions options)