void (@NotNull UsageViewDescriptor viewDescriptor, @NotNull Factory<? extends UsageSearcher> factory, UsageInfo @NotNull [] usageInfos) { UsageViewManager viewManager = UsageViewManager.getInstance(myProject); final PsiElement[] initialElements = viewDescriptor.getElements(); final UsageTarget[] targets = PsiElement2UsageTargetAdapter.convert(initialElements); final Ref<Usage[]> convertUsagesRef = new Ref<>(); if (!ProgressManager.getInstance().runProcessWithProgressSynchronously( () -> ApplicationManager.getApplication().runReadAction( () -> convertUsagesRef.set(UsageInfo2UsageAdapter.convert(usageInfos))), RefactoringBundle.message("refactoring.preprocess.usages.progress"), true, myProject)) return; if (convertUsagesRef.isNull()) return; final Usage[] usages = convertUsagesRef.get(); final UsageViewPresentation presentation = createPresentation(viewDescriptor, usages); if (myUsageView == null) { myUsageView = viewManager.showUsages(targets, usages, presentation, factory); customizeUsagesView(viewDescriptor, myUsageView); } else { myUsageView.removeUsagesBulk(myUsageView.getUsages()); ((UsageViewEx)myUsageView).appendUsagesInBulk(Arrays.asList(usages)); } Set<UnloadedModuleDescription> unloadedModules = computeUnloadedModulesFromUseScope(viewDescriptor); if (!unloadedModules.isEmpty()) { myUsageView.appendUsage(new UnknownUsagesInUnloadedModules(unloadedModules)); } }