File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
compiler/src/dotty/tools/repl Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,17 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None) {
64
64
myClassLoader
65
65
}
66
66
67
+ /** Used to elide output in replStringOf. TODO: Implement setting scala.repl.maxprintstring as in Scala 2 */
68
+ private [repl] def truncate (str : String ): String =
69
+ if str.length > MaxStringElements then (str take MaxStringElements - 3 ) + " ..."
70
+ else str
71
+
67
72
/** Return a String representation of a value we got from `classLoader()`. */
68
73
private [repl] def replStringOf (value : Object )(using Context ): String = {
74
+
69
75
assert(myReplStringOf != null ,
70
76
" replStringOf should only be called on values creating using `classLoader()`, but `classLoader()` has not been called so far" )
71
- myReplStringOf(value)
77
+ truncate( myReplStringOf(value) )
72
78
}
73
79
74
80
/** Load the value of the symbol using reflection.
You can’t perform that action at this time.
0 commit comments