private @Nullable RunnerAndConfigurationSettings findSettings(@NotNull RunContentDescriptor descriptor) {
    Set<ExecutionEnvironment> environments = ExecutionManagerImpl.getInstance(myProject).getExecutionEnvironments(descriptor);
    ExecutionEnvironment environment = ContainerUtil.getFirstItem(environments);
    if (environment == null) return null;

    RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings();
    if (settings != null) {
      return settings;
    }

    RunProfile runProfile = environment.getRunProfile();
    if (!(runProfile instanceof RunConfiguration runConfiguration)) return null;

    myServiceLock.readLock().lock();
    try {
      for (List<RunDashboardServiceImpl> services : myServices) {
        for (RunDashboardServiceImpl service : services) {
          if (runConfiguration.equals(service.getSettings().getConfiguration())) {
            return service.getSettings();
          }
        }
      }
    }
    finally {
      myServiceLock.readLock().unlock();
    }
    return new RunnerAndConfigurationSettingsImpl(RunManagerImpl.getInstanceImpl(myProject), runConfiguration);
  }
private @Nullable RunnerAndConfigurationSettings findSettings(@NotNull RunContentDescriptor descriptor)