public UsageView doFindUsages(PsiElement @NotNull [] primaryElements,
                                PsiElement @NotNull [] secondaryElements,
                                @NotNull FindUsagesHandlerBase handler,
                                @NotNull FindUsagesOptions findUsagesOptions,
                                boolean toSkipUsagePanelWhenOneUsage, UsageViewPresentation presentation) {
    if (primaryElements.length == 0) {
      throw new AssertionError(handler + " " + findUsagesOptions);
    }
    PsiElement2UsageTargetAdapter[] primaryTargets = convertToUsageTargets(Arrays.asList(primaryElements), findUsagesOptions);
    PsiElement2UsageTargetAdapter[] secondaryTargets = convertToUsageTargets(Arrays.asList(secondaryElements), findUsagesOptions);
    PsiElement2UsageTargetAdapter[] targets = ArrayUtil.mergeArrays(primaryTargets, secondaryTargets);
    Factory<UsageSearcher> factory = () -> createUsageSearcher(primaryTargets, secondaryTargets, handler, findUsagesOptions, null);
    UsageView usageView = UsageViewManager.getInstance(myProject).searchAndShowUsages(targets,
                                                                                      factory, !toSkipUsagePanelWhenOneUsage,
                                                                                      true,
                                                                                      presentation,
                                                                                      null);
    PsiElement2UsageTargetAdapter target = targets[0];
    ReadAction.nonBlocking(() -> target.getLongDescriptiveName())
      .expireWith(usageView != null ? usageView : handler.getProject())
      .finishOnUiThread(ModalityState.nonModal(), descriptiveName -> myHistory.add(target, descriptiveName))
      .submit(AppExecutorUtil.getAppExecutorService());

    return usageView;
  }
public UsageView doFindUsages(PsiElement @NotNull [] primaryElements,
                                PsiElement @NotNull [] secondaryElements,
                                @NotNull FindUsagesHandlerBase handler,
                                @NotNull FindUsagesOptions findUsagesOptions,
                                boolean toSkipUsagePanelWhenOneUsage, UsageViewPresentation presentation)