File tree Expand file tree Collapse file tree 6 files changed +12
-12
lines changed
src/dotty/tools/dotc/reporting
doc-tool/src/dotty/tools/dottydoc Expand file tree Collapse file tree 6 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -91,15 +91,15 @@ trait MessageRendering {
91
91
* @return aligned error message
92
92
*/
93
93
def errorMsg (pos : SourcePosition , msg : String , offset : Int )(implicit ctx : Context ): String = {
94
- val padding = msg.lines .foldLeft(pos.startColumnPadding) { (pad, line) =>
94
+ val padding = msg.linesIterator .foldLeft(pos.startColumnPadding) { (pad, line) =>
95
95
val lineLength = stripColor(line).length
96
96
val maxPad = math.max(0 , ctx.settings.pageWidth.value - offset - lineLength) - offset
97
97
98
98
if (maxPad < pad.length) " " * maxPad
99
99
else pad
100
100
}
101
101
102
- msg.lines
102
+ msg.linesIterator
103
103
.map { line => " " * (offset - 1 ) + " |" + padding + line}
104
104
.mkString(sys.props(" line.separator" ))
105
105
}
Original file line number Diff line number Diff line change @@ -613,7 +613,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
613
613
else runMain(testSource.runClassPath) match {
614
614
case Success (_) if ! checkFile.isDefined || ! checkFile.get.exists => // success!
615
615
case Success (output) => {
616
- val outputLines = output.lines .toArray :+ DiffUtil .EOF
616
+ val outputLines = output.linesIterator .toArray :+ DiffUtil .EOF
617
617
val checkLines : Array [String ] = Source .fromFile(checkFile.get).getLines().toArray :+ DiffUtil .EOF
618
618
val sourceTitle = testSource.title
619
619
@@ -1027,7 +1027,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
1027
1027
case test.TimeoutFailure (title) =>
1028
1028
s " - test ' $title' timed out "
1029
1029
case test.JavaCompilationFailure (msg) =>
1030
- s " - java compilation failed with: \n ${ msg.lines .map(" " + _).mkString(" \n " ) }"
1030
+ s " - java compilation failed with: \n ${ msg.linesIterator .map(" " + _).mkString(" \n " ) }"
1031
1031
}.mkString(" \n " )
1032
1032
}
1033
1033
Original file line number Diff line number Diff line change @@ -21,6 +21,6 @@ trait CommentCleaner {
21
21
SafeTags .replaceAllIn(javadoclessComment, { mtch =>
22
22
Matcher .quoteReplacement(safeTagMarker + mtch.matched + safeTagMarker)
23
23
})
24
- markedTagComment.lines .toList map (cleanLine)
24
+ markedTagComment.linesIterator .toList map (cleanLine)
25
25
}
26
26
}
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ trait Page {
115
115
val withoutYaml = virtualFile(
116
116
if (content.startsWith(" ---\n " )) {
117
117
val str =
118
- content.lines
118
+ content.linesIterator
119
119
.drop(1 )
120
120
.dropWhile(line => line != " ---" && line != " ..." )
121
121
.drop(1 ).mkString(" \n " )
Original file line number Diff line number Diff line change @@ -75,11 +75,11 @@ object RichStringTest1 extends RichTest {
75
75
object RichStringTest2 extends RichTest {
76
76
def run : Unit = {
77
77
println(" \n " + getObjectName + " :" )
78
- Console .print(" s1: " ); s1.lines foreach println
79
- Console .print(" s2: " ); s2.lines foreach println
80
- Console .print(" s3: " ); s3.lines foreach println
81
- Console .print(" s4: " ); s4.lines foreach println
82
- Console .print(" s5: " ); s5.lines foreach println
78
+ Console .print(" s1: " ); s1.linesIterator foreach println
79
+ Console .print(" s2: " ); s2.linesIterator foreach println
80
+ Console .print(" s3: " ); s3.linesIterator foreach println
81
+ Console .print(" s4: " ); s4.linesIterator foreach println
82
+ Console .print(" s5: " ); s5.linesIterator foreach println
83
83
}
84
84
}
85
85
object RichStringTest3 extends RichTest {
Original file line number Diff line number Diff line change 2
2
object Test extends dotty.runtime.LegacyApp {
3
3
val ms = """ This is a long multiline string
4
4
with \u000d\u000a CRLF embedded."""
5
- assert(ms.lines .size == 3 , s " lines.size ${ms.lines .size}" )
5
+ assert(ms.linesIterator .size == 3 , s " lines.size ${ms.linesIterator .size}" )
6
6
assert(ms contains " \r\n CRLF" , " no CRLF" )
7
7
}
You can’t perform that action at this time.
0 commit comments