Skip to content

Commit 7bd6fa9

Browse files
authored
Merge branch 'main' into scala-3.3.2
2 parents 2f05fc0 + fa93d2a commit 7bd6fa9

File tree

9 files changed

+19
-20
lines changed

9 files changed

+19
-20
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ lazy val expressionCompiler = projectMatrix
164164
case (3, 0) => Seq("3.0.2", "3.0.1", "3.0.0")
165165
case (3, 1 | 2 | 3) =>
166166
Seq("3.3.2", "3.3.1", "3.3.0", "3.2.2", "3.2.1", "3.2.0", "3.1.3", "3.1.2", "3.1.1", "3.1.0")
167-
case (3, _) => Seq("3.4.0-RC4")
167+
case (3, _) => Seq("3.4.0")
168168
}
169169
.toSeq
170170
.flatten,

modules/core/src/main/scala/ch/epfl/scala/debugadapter/Debuggee.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ trait Debuggee {
1212
def libraries: Seq[Library]
1313
def unmanagedEntries: Seq[UnmanagedEntry]
1414
def javaRuntime: Option[JavaRuntime]
15-
def observeClassesToUpdate(updateClasses: Seq[String] => Unit): Closeable
15+
def observeClassUpdates(onClassUpdate: Seq[String] => Unit): Closeable
1616

1717
def managedEntries: Seq[ManagedEntry] = modules ++ libraries
1818
def classPathEntries: Seq[ClassPathEntry] = managedEntries ++ unmanagedEntries

modules/core/src/main/scala/ch/epfl/scala/debugadapter/internal/HotCodeReplaceProvider.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class HotCodeReplaceProvider(
4545
override def initialize(context: IDebugAdapterContext, options: ju.Map[String, Object]): Unit = {
4646
this.context = context
4747
this.currentDebugSession = context.getDebugSession
48-
this.subscription = debuggee.observeClassesToUpdate(classes => classesAccumulator.updateAndGet(_ ++ classes))
48+
this.subscription = debuggee.observeClassUpdates(classes => classesAccumulator.updateAndGet(_ ++ classes))
4949
this.sourceLookUp = context.getProvider(classOf[ISourceLookUpProvider]).asInstanceOf[SourceLookUpProvider]
5050
this.stackTraceProvider = context.getProvider(classOf[IStackTraceProvider]).asInstanceOf[StackTraceProvider]
5151
}

modules/sbt-plugin/src/main/scala/ch/epfl/scala/debugadapter/sbtplugin/DebugAdapterPlugin.scala

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ object DebugAdapterPlugin extends sbt.AutoPlugin {
6464
inputKey[URI]("Start a debug session for running test suites").withRank(KeyRanks.DTask)
6565
val startRemoteDebugSession =
6666
inputKey[URI]("Start a debug session on a remote process").withRank(KeyRanks.DTask)
67-
val debugAdapterConfig =
68-
settingKey[DebugConfig]("Configure the debug session").withRank(KeyRanks.DTask)
69-
val debugAdapterClassesToUpdate =
67+
val debugAdapterConfig = settingKey[DebugConfig]("Configure the debug session").withRank(KeyRanks.DTask)
68+
val debugAdapterClassUpdates =
7069
settingKey[PublishSubject[Seq[String]]]("Observe the classes to be reloaded by the debuggee")
7170
.withRank(KeyRanks.DTask)
7271
val stopDebugSession =
@@ -108,7 +107,7 @@ object DebugAdapterPlugin extends sbt.AutoPlugin {
108107
startMainClassDebugSession := mainClassSessionTask.evaluated,
109108
startRemoteDebugSession := remoteSessionTask.evaluated,
110109
stopDebugSession := stopSessionTask.value,
111-
debugAdapterClassesToUpdate := PublishSubject.create(),
110+
debugAdapterClassUpdates := PublishSubject.create(),
112111
Keys.compile / Keys.javacOptions := {
113112
val jo = (Keys.compile / Keys.javacOptions).value
114113
if (jo.exists(_.startsWith("-g"))) jo
@@ -117,10 +116,10 @@ object DebugAdapterPlugin extends sbt.AutoPlugin {
117116
Keys.compile := {
118117
val currentAnalysis: CompileAnalysis = Keys.compile.value
119118
val previousAnalysis = Keys.previousCompile.value.analysis
120-
val classesToUpdate = debugAdapterClassesToUpdate.value
119+
val classesToUpdate = debugAdapterClassUpdates.value
121120
val fileConverter = Keys.fileConverter.value
122121
val classDir = Keys.classDirectory.value.toPath
123-
if (previousAnalysis.isPresent) {
122+
if (previousAnalysis.isPresent && classesToUpdate.hasObservers) {
124123
val currentStamps = currentAnalysis.readStamps
125124
val previousStamps = previousAnalysis.get.readStamps
126125
val newClasses = getNewClasses(currentStamps, previousStamps, fileConverter, classDir)
@@ -283,7 +282,7 @@ object DebugAdapterPlugin extends sbt.AutoPlugin {
283282
InternalTasks.libraries.value,
284283
InternalTasks.unmanagedEntries.value,
285284
InternalTasks.javaRuntime.value,
286-
InternalTasks.classesToUpdate.value,
285+
InternalTasks.allClassUpdates.value,
287286
mainClass.`class`,
288287
mainClass.arguments,
289288
new LoggerAdapter(logger)
@@ -389,7 +388,7 @@ object DebugAdapterPlugin extends sbt.AutoPlugin {
389388
InternalTasks.libraries.value,
390389
InternalTasks.unmanagedEntries.value,
391390
InternalTasks.javaRuntime.value,
392-
InternalTasks.classesToUpdate.value,
391+
InternalTasks.allClassUpdates.value,
393392
cleanups,
394393
parallel,
395394
testRunners,
@@ -455,7 +454,7 @@ object DebugAdapterPlugin extends sbt.AutoPlugin {
455454
InternalTasks.libraries.value,
456455
InternalTasks.unmanagedEntries.value,
457456
InternalTasks.javaRuntime.value,
458-
InternalTasks.classesToUpdate.value,
457+
InternalTasks.allClassUpdates.value,
459458
new LoggerAdapter(logger)
460459
)
461460
startServer(jobService, scope, state, target, debuggee, debugToolsResolver, debugAdapterConfig.value)

modules/sbt-plugin/src/main/scala/ch/epfl/scala/debugadapter/sbtplugin/internal/InternalTasks.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ private[sbtplugin] object InternalTasks {
1717
modules.join(_.join)
1818
}
1919

20-
lazy val classesToUpdate: Def.Initialize[Observable[Seq[String]]] = Def.settingDyn {
20+
lazy val allClassUpdates: Def.Initialize[Observable[Seq[String]]] = Def.settingDyn {
2121
val internalDependencies = Keys.bspInternalDependencyConfigurations
2222
val observables = for {
2323
(proj, configs) <- Keys.bspInternalDependencyConfigurations.value
2424
config <- configs
25-
} yield (proj / config / debugAdapterClassesToUpdate)
25+
} yield (proj / config / debugAdapterClassUpdates)
2626
Def.setting {
2727
observables.join.value.fold(Observable.empty[Seq[String]])(_ mergeWith _)
2828
}

modules/sbt-plugin/src/main/scala/ch/epfl/scala/debugadapter/sbtplugin/internal/SbtDebuggee.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ private[debugadapter] sealed trait SbtDebuggee extends Debuggee {
2020
val logger: LoggerAdapter
2121
val classesToUpdate: Observable[Seq[String]]
2222

23-
override def observeClassesToUpdate(updateClasses: Seq[String] => Unit): Closeable = {
24-
val subscription = classesToUpdate.subscribe(updateClasses(_))
23+
override def observeClassUpdates(onClassUpdate: Seq[String] => Unit): Closeable = {
24+
val subscription = classesToUpdate.subscribe(onClassUpdate(_))
2525
() => if (!subscription.isDisposed) subscription.dispose
2626
}
2727
}

modules/tests/src/main/scala/ch/epfl/scala/debugadapter/testfmk/MockDebuggee.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MockDebuggee extends Debuggee {
3434

3535
override def javaRuntime: Option[JavaRuntime] = None
3636

37-
override def observeClassesToUpdate(updateClasses: Seq[String] => Unit): Closeable = () => ()
37+
override def observeClassUpdates(onClassUpdate: Seq[String] => Unit): Closeable = () => ()
3838
}
3939

4040
class MockCancelableFuture() extends CancelableFuture[Unit] {

modules/tests/src/main/scala/ch/epfl/scala/debugadapter/testfmk/TestingDebuggee.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ case class TestingDebuggee(
4343
with TestingContext {
4444

4545
val classesToUpdate: Subject[Seq[String]] = PublishSubject.create()
46-
override def observeClassesToUpdate(updateClasses: Seq[String] => Unit): Closeable = {
47-
val subscription = classesToUpdate.subscribe(updateClasses(_))
46+
override def observeClassUpdates(onClassUpdate: Seq[String] => Unit): Closeable = {
47+
val subscription = classesToUpdate.subscribe(onClassUpdate(_))
4848
() => if (!subscription.isDisposed) subscription.dispose
4949
}
5050
def mainSource: Path = sourceFiles.head

project/Dependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ object Dependencies {
66
val scala213 = scalaEnvVersion.filter(isScala213).getOrElse("2.13.12")
77
val scala30 = scalaEnvVersion.filter(isScala30).getOrElse("3.0.2")
88
val scala33 = scalaEnvVersion.filter(isScala33).getOrElse("3.3.2")
9-
val scala34 = scalaEnvVersion.filter(isScala34).getOrElse("3.4.0-RC4")
9+
val scala34 = scalaEnvVersion.filter(isScala34).getOrElse("3.4.0")
1010
val asmVersion = "9.6"
1111
val coursierVersion = "2.1.9"
1212

0 commit comments

Comments
 (0)