Skip to content

Commit 94ff30a

Browse files
committed
Make multiline strings use stripMargin correctly
1 parent a9157c7 commit 94ff30a

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

language-server/test/dotty/tools/languageserver/DocumentSymbolTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class DocumentSymbolTest {
3434

3535
@Test def documentSymbolShowClassAndCompanion: Unit = {
3636
code"""object ${m1}Foo${m2}
37-
class ${m3}Foo${m4}""".withSource
37+
|class ${m3}Foo${m4}""".withSource
3838
.documentSymbol(m1, (m1 to m2).symInfo("Foo", SymbolKind.Module),
3939
(m3 to m4).symInfo("Foo", SymbolKind.Class))
4040
}

language-server/test/dotty/tools/languageserver/ReferencesTest.scala

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ReferencesTest {
3737

3838
@Test def classReferenceCompanion: Unit = {
3939
code"""class ${m1}Foo${m2}(x: Any)
40-
object ${m3}Foo${m4} { val bar = new ${m5}Foo${m6}(${m7}Foo${m8}) }""".withSource
40+
|object ${m3}Foo${m4} { val bar = new ${m5}Foo${m6}(${m7}Foo${m8}) }""".withSource
4141
.references(m1 to m2, List(m1 to m2, m5 to m6), withDecl = true)
4242
.references(m1 to m2, List(m5 to m6), withDecl = false)
4343
.references(m3 to m4, List(m3 to m4, m7 to m8), withDecl = true)
@@ -50,9 +50,9 @@ class ReferencesTest {
5050

5151
@Test def anonClassTrait: Unit = {
5252
code"""trait ${m1}Foo${m2}
53-
object O {
54-
val foo = new ${m3}Foo${m4} {}
55-
}""".withSource
53+
|object O {
54+
| val foo = new ${m3}Foo${m4} {}
55+
|}""".withSource
5656
.references(m1 to m2, List(m1 to m2, m3 to m4), withDecl = true)
5757
.references(m1 to m2, List(m3 to m4), withDecl = false)
5858
.references(m3 to m4, List(m1 to m2, m3 to m4), withDecl = true)
@@ -170,12 +170,12 @@ class ReferencesTest {
170170

171171
val p1 = Project.dependingOn(p0).withSources(
172172
code"""class B {
173-
val a = new A()
174-
val z = new a.Z()
175-
val y = new z.Y()
176-
val x = new y.X()
177-
x.${m3}x${m4}
178-
}"""
173+
| val a = new A()
174+
| val z = new a.Z()
175+
| val y = new z.Y()
176+
| val x = new y.X()
177+
| x.${m3}x${m4}
178+
|}"""
179179
)
180180

181181
withProjects(p0, p1)
@@ -204,12 +204,12 @@ class ReferencesTest {
204204
@Test def findReferencesInUntouchedProject: Unit = {
205205
val p0 = Project.withSources(
206206
code"""package hello
207-
object A { def ${m1}foo${m2} = 1 }"""
207+
|object A { def ${m1}foo${m2} = 1 }"""
208208
)
209209

210210
val p1 = Project.dependingOn(p0).withSources(
211211
tasty"""package hello
212-
object B { def bar = A.${m3}foo${m4} }"""
212+
|object B { def bar = A.${m3}foo${m4} }"""
213213
)
214214

215215
withProjects(p0, p1)
@@ -219,8 +219,8 @@ class ReferencesTest {
219219

220220
@Test def importReference1: Unit = {
221221
code"""import ${m1}Foo${m2}._
222-
object ${m3}Foo${m4} { def ${m5}bar${m6}: Int = 0 }
223-
trait Bar { def buzz = ${m7}bar${m8} }""".withSource
222+
|object ${m3}Foo${m4} { def ${m5}bar${m6}: Int = 0 }
223+
|trait Bar { def buzz = ${m7}bar${m8} }""".withSource
224224

225225
.references(m1 to m2, List(m1 to m2, m3 to m4), withDecl = true)
226226
.references(m1 to m2, List(m1 to m2), withDecl = false)
@@ -266,7 +266,7 @@ class ReferencesTest {
266266

267267
@Test def importReferenceClassAndCompanion: Unit = {
268268
code"""object Foo { object ${m1}Bar${m2}; class ${m3}Bar${m4} }
269-
trait Buzz { import Foo.${m5}Bar${m6} }""".withSource
269+
|trait Buzz { import Foo.${m5}Bar${m6} }""".withSource
270270
.references(m1 to m2, List(m1 to m2, m5 to m6), withDecl = true)
271271
.references(m1 to m2, List(m5 to m6), withDecl = false)
272272
.references(m3 to m4, List(m3 to m4, m5 to m6), withDecl = true)
@@ -277,7 +277,7 @@ class ReferencesTest {
277277

278278
@Test def importReferenceWithRename: Unit = {
279279
code"""object ${m1}Foo${m2} { object ${m3}Bar${m4} { object ${m5}Baz${m6} } }
280-
trait Buzz { import ${m7}Foo${m8}.${m9}Bar${m10}.{${m11}Baz${m12} => ${m13}Quux${m14}}""".withSource
280+
|trait Buzz { import ${m7}Foo${m8}.${m9}Bar${m10}.{${m11}Baz${m12} => ${m13}Quux${m14}}""".withSource
281281

282282
.references(m1 to m2, List(m1 to m2, m7 to m8), withDecl = true)
283283
.references(m1 to m2, List(m7 to m8), withDecl = false)
@@ -297,7 +297,7 @@ class ReferencesTest {
297297

298298
@Test def importReferenceClassAndCompanionWithRename: Unit = {
299299
code"""object ${m1}Foo${m2} { object ${m3}Bar${m4}; class ${m5}Bar${m6} }
300-
trait Buzz { import ${m7}Foo${m8}.{${m9}Bar${m10} => ${m11}Baz${m12}} }""".withSource
300+
|trait Buzz { import ${m7}Foo${m8}.{${m9}Bar${m10} => ${m11}Baz${m12}} }""".withSource
301301

302302
.references(m1 to m2, List(m1 to m2, m7 to m8), withDecl = true)
303303
.references(m1 to m2, List(m7 to m8), withDecl = false)
@@ -315,7 +315,7 @@ class ReferencesTest {
315315

316316
@Test def importReferenceMembers: Unit = {
317317
code"""object Foo { def ${m1}bar${m2} = 2; type ${m3}bar${m4} = fizz; class fizz }
318-
trait Quux { import Foo.{${m5}bar${m6} => ${m7}buzz${m8}} }""".withSource
318+
|trait Quux { import Foo.{${m5}bar${m6} => ${m7}buzz${m8}} }""".withSource
319319

320320
.references(m1 to m2, List(m1 to m2, m5 to m6, m7 to m8), withDecl = true)
321321
.references(m1 to m2, List(m5 to m6, m7 to m8), withDecl = false)
@@ -331,7 +331,7 @@ class ReferencesTest {
331331
withSources(
332332
code"""object A { class ${m1}B${m2}; class ${m3}C${m4} }""",
333333
code"""import A.{${m5}B${m6} => ${m7}B2${m8}, ${m9}C${m10} => ${m11}C2${m12}}
334-
class E"""
334+
|class E"""
335335
).references(m1 to m2, List(m1 to m2, m5 to m6, m7 to m8), withDecl = true)
336336
.references(m1 to m2, List(m5 to m6, m7 to m8), withDecl = false)
337337
.references(m3 to m4, List(m3 to m4, m9 to m10, m11 to m12), withDecl = true)

language-server/test/dotty/tools/languageserver/SymbolTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SymbolTest {
3535

3636
@Test def symbolShowClassAndCompanion: Unit = {
3737
code"""object ${m1}Foo${m2}
38-
class ${m3}Foo${m4}""".withSource
38+
|class ${m3}Foo${m4}""".withSource
3939
.symbol("Foo", (m1 to m2).symInfo("Foo", SymbolKind.Module),
4040
(m3 to m4).symInfo("Foo", SymbolKind.Class))
4141
}

language-server/test/dotty/tools/languageserver/WorksheetTest.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class WorksheetTest {
4242

4343
@Test def defineCaseClass: Unit = {
4444
ws"""${m1}case class Foo(x: Int)${m2}
45-
${m3}Foo(1)${m4}""".withSource
45+
|${m3}Foo(1)${m4}""".withSource
4646
.run(m1,
4747
((m1 to m2), "// defined case class Foo"),
4848
((m3 to m4), "val res0: Foo = Foo(1)"))
@@ -68,10 +68,10 @@ class WorksheetTest {
6868

6969
@Test def defineAnonymousClass1: Unit = {
7070
ws"""${m1}class Foo${m2}
71-
${m3}trait Bar${m4}
72-
${m5}new Foo with Bar {
73-
override def toString: String = "Foo"
74-
}${m6}""".withSource
71+
|${m3}trait Bar${m4}
72+
|${m5}new Foo with Bar {
73+
| override def toString: String = "Foo"
74+
|}${m6}""".withSource
7575
.run(m1,
7676
((m1 to m2), "// defined class Foo"),
7777
((m3 to m4), "// defined trait Bar"),

0 commit comments

Comments
 (0)