diff --git a/compiler/src/dotty/tools/repl/ReplDriver.scala b/compiler/src/dotty/tools/repl/ReplDriver.scala index f69a7ca142fb..11073e309709 100644 --- a/compiler/src/dotty/tools/repl/ReplDriver.scala +++ b/compiler/src/dotty/tools/repl/ReplDriver.scala @@ -391,7 +391,16 @@ class ReplDriver(settings: Array[String], state case Reset(arg) => - resetToInitial(tokenize(arg)) + val tokens = tokenize(arg) + + if tokens.nonEmpty then + out.println(s"""|Resetting REPL state with the following settings: + | ${tokens.mkString("\n ")} + |""".stripMargin) + else + out.println("Resetting REPL state.") + + resetToInitial(tokens) initialState case Imports => diff --git a/compiler/test-resources/repl/reset-command b/compiler/test-resources/repl/reset-command index ad38c9e9a867..5ec643f28b0e 100644 --- a/compiler/test-resources/repl/reset-command +++ b/compiler/test-resources/repl/reset-command @@ -3,6 +3,8 @@ there were 1 deprecation warning(s); re-run with -deprecation for details def f(thread: Thread): Unit scala>:reset -deprecation +Resetting REPL state with the following settings: + -deprecation scala> def f(thread: Thread) = thread.stop() 1 warning found @@ -16,6 +18,7 @@ scala> def resetNoArgsStillWorks = 1 def resetNoArgsStillWorks: Int scala>:reset +Resetting REPL state. scala> resetNoArgsStillWorks -- [E006] Not Found Error: -----------------------------------------------------