@@ -24,8 +24,9 @@ import dotc.transform.ValueClasses
24
24
* `ReplDriver#resetToInitial` is called, the accompanying instance of
25
25
* `Rendering` is no longer valid.
26
26
*/
27
- private [repl] class Rendering (parentClassLoader : Option [ClassLoader ] = None ,
28
- maxPrintElements : Int = 1000 ):
27
+ private [repl] class Rendering (parentClassLoader : Option [ClassLoader ] = None ):
28
+ // val maxPrintElements: Int = 1000
29
+ // rootCtx.settings.VreplMaxPrintElements.valueIn(rootCtx.settingsState)
29
30
30
31
import Rendering ._
31
32
@@ -34,7 +35,7 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None,
34
35
private var myReplStringOf : Object => String = _
35
36
36
37
/** Class loader used to load compiled code */
37
- private [repl] def classLoader ()(using Context ) =
38
+ private [repl] def classLoader ()(using ctx : Context ) =
38
39
if (myClassLoader != null && myClassLoader.root == ctx.settings.outputDir.value) myClassLoader
39
40
else {
40
41
val parent = Option (myClassLoader).orElse(parentClassLoader).getOrElse {
@@ -50,6 +51,7 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None,
50
51
}
51
52
52
53
myClassLoader = new AbstractFileClassLoader (ctx.settings.outputDir.value, parent)
54
+ val maxPrintElements = ctx.settings.VreplMaxPrintElements .valueIn(ctx.settingsState)
53
55
myReplStringOf = {
54
56
// We need to use the ScalaRunTime class coming from the scala-library
55
57
// on the user classpath, and not the one available in the current
@@ -79,7 +81,8 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None,
79
81
* then this bug will surface, so perhaps better not?
80
82
* https://github.com/scala/bug/issues/12337
81
83
*/
82
- private [repl] def truncate (str : String ): String =
84
+ private [repl] def truncate (str : String )(using ctx : Context ): String =
85
+ val maxPrintElements = ctx.settings.VreplMaxPrintElements .valueIn(ctx.settingsState)
83
86
val showTruncated = " ... large output truncated, print value to show all"
84
87
val ncp = str.codePointCount(0 , str.length) // to not cut inside code point
85
88
if ncp <= maxPrintElements then str
0 commit comments