Promise<Boolean> (@NotNull DataContext context, @NotNull RunConfiguration configuration, @NotNull RunConfigurableBeforeRunTask task) { Project project = configuration.getProject(); RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(project); List<RunConfiguration> configurations = ContainerUtil.map(getAvailableConfigurations(configuration), it -> it.getConfiguration()); AsyncPromise<Boolean> result = new AsyncPromise<>(); ConfigurationSelectionUtil.createPopup(project, runManager, configurations, (selectedConfigs, selectedTarget) -> { RunConfiguration selectedConfig = ContainerUtil.getFirstItem(selectedConfigs); RunnerAndConfigurationSettings selectedSettings = selectedConfig == null ? null : runManager.getSettings(selectedConfig); if (selectedSettings != null) { task.setSettingsWithTarget(selectedSettings, selectedTarget); result.setResult(true); } else { result.setResult(false); } }).showInBestPositionFor(context); return result; }