boolean (@Nullable Project project, @NotNull DiffRequestChain chain, @NotNull DiffDialogHints hints) { if (chain instanceof AsyncDiffRequestChain asyncChain) { return show(project, hints, indicator -> { ListSelection<? extends DiffRequestProducer> listSelection = asyncChain.loadRequestsInBackground(); List<? extends DiffRequestProducer> producers = listSelection.getExplicitSelection(); if (!wantShowExternalToolFor(producers)) return null; if (!checkNotTooManyRequests(project, producers)) return null; return collectRequests(project, producers, indicator); }); } else { ListSelection<? extends DiffRequestProducer> listSelection; if (chain instanceof DiffRequestSelectionChain selectionChain) { listSelection = selectionChain.getListSelection(); } else { listSelection = ListSelection.createAt(chain.getRequests(), chain.getIndex()); } return show(project, hints, indicator -> { List<? extends DiffRequestProducer> producers = listSelection.getExplicitSelection(); if (!wantShowExternalToolFor(producers)) return null; if (!checkNotTooManyRequests(project, producers)) return null; return collectRequests(project, producers, indicator); }); } }