void (@NotNull ProgressIndicator indicator) { UsageInfo usageInfo = ReadAction.compute(() -> SearchEverywherePreview.getFileFirstUsage(selectedValue)); List<UsageInfo2UsageAdapter> usages = new ArrayList<>(); if (usageInfo != null) { usages.add(new UsageInfo2UsageAdapter(usageInfo)); } else { if (selectedValue instanceof UsageInfo2UsageAdapter) { usages.add((UsageInfo2UsageAdapter)selectedValue); } else if (selectedValue instanceof SearchEverywhereItem) { usages.add(((SearchEverywhereItem)selectedValue).getUsage()); } } if (myProject != null) { UsageAdaptersKt.getUsageInfo(usages, myProject).thenAccept(infos -> { List<UsageInfo> usageInfos = !infos.isEmpty() ? infos : null; ReadAction.nonBlocking(() -> UsagePreviewPanel.isOneAndOnlyOnePsiFileInUsages(usageInfos)) .finishOnUiThread(ModalityState.nonModal(), isOneAndOnlyOnePsiFileInUsages -> { myUsagePreviewPanel.updateLayout(usageInfos); }) .coalesceBy(this) .submit(AppExecutorUtil.getAppExecutorService()); }); } }