protected Promise<@NotNull XDebugSession> createSession(@NotNull RunProfileState state, final @NotNull ExecutionEnvironment environment) {
    return AppUIExecutor.onUiThread()
      .submit(FileDocumentManager.getInstance()::saveAllDocuments)
      .thenAsync(ignored -> {
        if (Registry.is("python.use.targets.api")) {
          return createSessionUsingTargetsApi(state, environment);
        }
        if (PyRunnerUtil.isTargetBasedSdkAssigned(state)) {
          Project project = environment.getProject();
          Module module = PyRunnerUtil.getModule(state);
          throw new RuntimeExceptionWithHyperlink(PyBundle.message("runcfg.error.message.python.interpreter.is.invalid.configure"),
                                                  () -> showPythonInterpreterSettings(project, module));
        }
        return createSessionLegacy(state, environment);
      });
  }
protected Promise<@NotNull XDebugSession> createSession(@NotNull RunProfileState state, final @NotNull ExecutionEnvironment environment)