File tree 1 file changed +11
-0
lines changed
compiler/src/dotty/tools/repl
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,17 @@ class ReplDriver(settings: Array[String],
187
187
// TODO: i5069
188
188
final def bind (name : String , value : Any )(using state : State ): State = state
189
189
190
+ /**
191
+ * Controls whether the `System.out` and `System.err` streams are set to the provided constructor parameter instance
192
+ * of [[java.io.PrintStream ]] during the execution of the repl. On by default.
193
+ *
194
+ * Disabling this can be beneficial when executing a repl instance inside a concurrent environment, for example a
195
+ * thread pool (such as the Scala compile server in the Scala Plugin for IntelliJ IDEA).
196
+ *
197
+ * In such environments, indepently executing `System.setOut` and `System.setErr` without any synchronization can
198
+ * lead to unpredictable results when restoring the original streams (dependent on the order of execution), leaving
199
+ * the Java process in an inconsistent state.
200
+ */
190
201
protected def redirectOutput : Boolean = true
191
202
192
203
// redirecting the output allows us to test `println` in scripted tests
You can’t perform that action at this time.
0 commit comments