-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use PPrint to handle printing of REPL output values #23849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d03ac8f
690ba71
e143442
cf81680
1be063a
2562be1
96b6d03
8351dbe
4bcb2c5
85f73ce
8074f15
ce4e81d
f48a8d8
5ac49a6
10bb601
b79e803
f4b89d7
2a4a1c1
cb90ed2
a4cc58d
c7d109b
8082a5d
19fdaa1
d098ca8
236abf2
0e78df2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
scala> def o(s: String) = "o"; def oo(s: String) = "oo"; val o = "o"; val oo = "oo" | ||
def o(s: String): String | ||
def oo(s: String): String | ||
val o: String = o | ||
val oo: String = oo | ||
val o: String = "o" | ||
val oo: String = "oo" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
scala> val d: Long = (new java.sql.Date(100L)).getTime | ||
val d: Long = 100 | ||
val d: Long = 100L |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
scala> scala.compiletime.codeOf(1+2) | ||
val res0: String = 1 + 2 | ||
val res0: String = "1 + 2" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
scala> print("foo") | ||
foo | ||
scala> "Hello" | ||
val res0: String = Hello | ||
val res0: String = "Hello" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
scala> val foo = "1"; foo.toInt | ||
val foo: String = 1 | ||
val foo: String = "1" | ||
val res0: Int = 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
scala> 1.to(10).mkString | ||
val res0: String = 12345678910 | ||
val res0: String = "12345678910" | ||
|
||
scala>:settings -Vrepl-max-print-characters:10 | ||
|
||
scala> 1.to(10).mkString | ||
val res1: String = 123456789 ... large output truncated, print value to show all | ||
val res1: String = "12345678910" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The old |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what's happening here before this PR, but there must be some super sketchy stdout-regexing happening to mangle the
.toString
so it looks different whenreturn
ed orprintln
-ed.The new behavior is probably better: we special case
return
ing because it usespprint
,println
is justprintln
, and if someone wantspprint
themselves they can usedotty.shaded.pprint.log