UsageView (PsiElement @NotNull [] primaryElements, PsiElement @NotNull [] secondaryElements, @NotNull FindUsagesHandlerBase handler, @NotNull FindUsagesOptions findUsagesOptions, boolean toSkipUsagePanelWhenOneUsage) { 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, createPresentation(primaryElements[0], findUsagesOptions, shouldOpenInNewTab()), null); myHistory.add(targets[0]); return usageView; }