Skip to content

Commit

Permalink
improvement: Forward cnacelPromise from DebugPRovider
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Aug 29, 2024
1 parent b7eb4f7 commit 22c7307
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 22c7307

Please sign in to comment.