diff --git a/metals/src/main/scala/scala/meta/internal/metals/debug/DebugProvider.scala b/metals/src/main/scala/scala/meta/internal/metals/debug/DebugProvider.scala index 8d40f3b352c..fd450de9f2e 100644 --- a/metals/src/main/scala/scala/meta/internal/metals/debug/DebugProvider.scala +++ b/metals/src/main/scala/scala/meta/internal/metals/debug/DebugProvider.scala @@ -335,7 +335,7 @@ class DebugProvider( case b.DebugSessionParamsDataKind.SCALA_MAIN_CLASS => for { id <- buildTarget - projectInfo <- debugConfigCreator.create(id) + projectInfo <- debugConfigCreator.create(id, cancelPromise) scalaMainClass <- params.asScalaMainClass() } yield projectInfo.map( new MainClassDebugAdapter( @@ -349,7 +349,7 @@ class DebugProvider( b.TestParamsDataKind.SCALA_TEST_SUITES) => for { id <- buildTarget - projectInfo <- debugConfigCreator.create(id) + projectInfo <- debugConfigCreator.create(id, cancelPromise) testSuites <- params.asScalaTestSuites() } yield { for { diff --git a/metals/src/main/scala/scala/meta/internal/metals/debug/server/DebugeeParamsCreator.scala b/metals/src/main/scala/scala/meta/internal/metals/debug/server/DebugeeParamsCreator.scala index 419e98d93e7..55317918e74 100644 --- a/metals/src/main/scala/scala/meta/internal/metals/debug/server/DebugeeParamsCreator.scala +++ b/metals/src/main/scala/scala/meta/internal/metals/debug/server/DebugeeParamsCreator.scala @@ -23,7 +23,8 @@ import ch.epfl.scala.debugadapter.UnmanagedEntry class DebugeeParamsCreator(buildTargetClasses: BuildTargetClasses) { val buildTargets = buildTargetClasses.buildTargets def create( - id: BuildTargetIdentifier + id: BuildTargetIdentifier, + cancelPromise: Promise[Unit], )(implicit ec: ExecutionContext): Either[String, Future[DebugeeProject]] = { for { target <- buildTargets @@ -51,7 +52,7 @@ class DebugeeParamsCreator(buildTargetClasses: BuildTargetClasses) { for { classpathString <- buildTargets - .targetClasspath(id, Promise()) + .targetClasspath(id, cancelPromise) .getOrElse(Future.successful(Nil)) jvmRunEnv <- buildTargetClasses.jvmRunEnvironment(id) } yield {