diff --git a/metals/src/main/scala/scala/meta/internal/metals/WorkspaceLspService.scala b/metals/src/main/scala/scala/meta/internal/metals/WorkspaceLspService.scala index 0d69a1b9228..174adfe9ac0 100644 --- a/metals/src/main/scala/scala/meta/internal/metals/WorkspaceLspService.scala +++ b/metals/src/main/scala/scala/meta/internal/metals/WorkspaceLspService.scala @@ -450,9 +450,9 @@ class WorkspaceLspService( override def inlayHints( params: lsp4j.InlayHintParams - ): CompletableFuture[java.util.List[lsp4j.InlayHint]] = + ): CompletableFuture[java.util.List[lsp4j.InlayHint]] = { getServiceFor(params.getTextDocument.getUri()).inlayHints(params) - + } override def inlayHintResolve( inlayHint: lsp4j.InlayHint ): CompletableFuture[lsp4j.InlayHint] = diff --git a/metals/src/main/scala/scala/meta/internal/worksheets/WorksheetProvider.scala b/metals/src/main/scala/scala/meta/internal/worksheets/WorksheetProvider.scala index efa57ac0b8f..62382975010 100644 --- a/metals/src/main/scala/scala/meta/internal/worksheets/WorksheetProvider.scala +++ b/metals/src/main/scala/scala/meta/internal/worksheets/WorksheetProvider.scala @@ -220,7 +220,6 @@ class WorksheetProvider( } else Future.successful(Nil) // TODO switch to only inlay hints - // TODO add tests private def toInlayHints( path: AbsolutePath, worksheet: Option[EvaluatedWorksheetSnapshot], @@ -242,7 +241,7 @@ class WorksheetProvider( } val hint = new InlayHint( statEnd, - messages.Either.forLeft(" // " + stat.summary()), + messages.Either.forLeft(" // " + truncatify(stat)), ) hint.setTooltip(stat.details()) hint diff --git a/tests/cross/src/main/scala/tests/BaseInlayHintsSuite.scala b/tests/cross/src/main/scala/tests/BaseInlayHintsSuite.scala index 346f5e0238a..bcc1df873f1 100644 --- a/tests/cross/src/main/scala/tests/BaseInlayHintsSuite.scala +++ b/tests/cross/src/main/scala/tests/BaseInlayHintsSuite.scala @@ -47,7 +47,8 @@ class BaseInlayHintsSuite extends BasePCSuite { .asScala .toList - val obtained = TestInlayHints.applyInlayHints(withPkg, inlayHints) + val obtained = + TestInlayHints.applyInlayHints(withPkg, inlayHints, withTooltip = false) assertEquals( obtained, diff --git a/tests/mtest/src/main/scala/tests/TestInlayHints.scala b/tests/mtest/src/main/scala/tests/TestInlayHints.scala index e1c25957708..554c418a5ba 100644 --- a/tests/mtest/src/main/scala/tests/TestInlayHints.scala +++ b/tests/mtest/src/main/scala/tests/TestInlayHints.scala @@ -24,20 +24,37 @@ object TestInlayHints { // | // v // val y<<: T/*(0:5,0:5)*/>> = x - def decorationString(inlayHint: InlayHint): String = { + def decorationString(inlayHint: InlayHint, withTooltip: Boolean): String = { val buffer = ListBuffer.empty[String] val labels = inlayHint.getLabel().asScala match { case Left(label) => List(label) case Right(labelParts) => labelParts.asScala.map(_.getValue()).toList } + + val tooltip = Option(inlayHint.getTooltip()).map(t => + t.asScala match { + case Left(tooltip) => tooltip + case Right(markdown) => markdown.getValue() + } + ) val data = inlayHint.getData().asInstanceOf[Array[Any]] buffer += "/*" - labels.zip(data).foreach { case (label, data) => - buffer += label - buffer ++= readData(data) + if (data != null) { + labels.zip(data).foreach { case (label, data) => + buffer += label + buffer ++= readData(data) + } + } else { + buffer += labels.mkString } + if (withTooltip) + tooltip.foreach { tooltip => + buffer += "| " + buffer += tooltip.replace("\n", "\\n") + buffer += " |" + } buffer += "*/" buffer.toList.mkString } @@ -52,9 +69,13 @@ object TestInlayHints { } } - def applyInlayHints(text: String, inlayHints: List[InlayHint]): String = { + def applyInlayHints( + text: String, + inlayHints: List[InlayHint], + withTooltip: Boolean + ): String = { val textEdits = inlayHints.map { hint => - val newText = decorationString(hint) + val newText = decorationString(hint, withTooltip) val range = new l.Range(hint.getPosition(), hint.getPosition()) new TextEdit( range, diff --git a/tests/unit/src/main/scala/tests/BaseInlayHintsExpectSuite.scala b/tests/unit/src/main/scala/tests/BaseInlayHintsExpectSuite.scala index 1c89f65f578..9537c9a2525 100644 --- a/tests/unit/src/main/scala/tests/BaseInlayHintsExpectSuite.scala +++ b/tests/unit/src/main/scala/tests/BaseInlayHintsExpectSuite.scala @@ -36,7 +36,11 @@ abstract class BaseInlayHintsExpectSuite( ) val inlayHints = compiler.inlayHints(pcParams).get().asScala.toList - TestInlayHints.applyInlayHints(file.code, inlayHints) + TestInlayHints.applyInlayHints( + file.code, + inlayHints, + withTooltip = false, + ) }, ) } diff --git a/tests/unit/src/main/scala/tests/BaseInlayHintsLspSuite.scala b/tests/unit/src/main/scala/tests/BaseInlayHintsLspSuite.scala index e5de66e1533..0c5da9990bc 100644 --- a/tests/unit/src/main/scala/tests/BaseInlayHintsLspSuite.scala +++ b/tests/unit/src/main/scala/tests/BaseInlayHintsLspSuite.scala @@ -49,6 +49,8 @@ abstract class BaseInlayHintsLspSuite(name: String, scalaVersion: String) code, expected, workspace, + withTooltip = false, + postprocessObtained = identity, ) } yield () } diff --git a/tests/unit/src/main/scala/tests/BaseWorksheetLspSuite.scala b/tests/unit/src/main/scala/tests/BaseWorksheetLspSuite.scala index d2868f5a300..cc7cf00e6f5 100644 --- a/tests/unit/src/main/scala/tests/BaseWorksheetLspSuite.scala +++ b/tests/unit/src/main/scala/tests/BaseWorksheetLspSuite.scala @@ -1,6 +1,7 @@ package tests import scala.concurrent.Promise +import scala.concurrent.duration._ import scala.meta.internal.metals.InitializationOptions import scala.meta.internal.metals.MetalsEnrichments._ @@ -77,16 +78,16 @@ abstract class BaseWorksheetLspSuite( ), ) _ = assertNoDiagnostics() - _ = assertNoDiff( - client.syntheticDecorations, + _ <- server.assertInlayHints( + "a/src/main/scala/foo/Main.worksheet.sc", getExpected( - """|identity(42) // : Int = 42 - |val name = sourcecode.Name.generate.value // : String = "name" + """|identity(42)/* // : Int = 42*/ + |val name = sourcecode.Name.generate.value/* // : String = "name"*/ |""".stripMargin, Map( "3" -> - """|identity(42) // : Int = 42 - |val name = sourcecode.Name.generate.value // : String = name + """|identity(42)/* // : Int = 42*/ + |val name = sourcecode.Name.generate.value/* // : String = name*/ |""".stripMargin ), scalaVersion, @@ -106,11 +107,9 @@ abstract class BaseWorksheetLspSuite( |""".stripMargin ) _ <- server.didOpen("a/Main.worksheet.sc") - // check that ANSI colors were stripped - _ = assertNotContains(client.syntheticDecorations, "\u001b") - _ = assertNoDiff( - client.syntheticDecorations, - """|pprint.pprintln("Hello, world!") // "Hello, world!" + _ <- server.assertInlayHints( + "a/Main.worksheet.sc", + """|pprint.pprintln("Hello, world!")/* // "Hello, world!"*/ |""".stripMargin, ) } yield () @@ -134,25 +133,24 @@ abstract class BaseWorksheetLspSuite( ) _ <- server.didOpen("a/Main.worksheet.sc") _ = assertNoDiagnostics() - _ = assertNoDiff( - client.syntheticDecorations, + _ <- server.assertInlayHints( + "a/Main.worksheet.sc", getExpected( """|import java.nio.file.Files - |val name = "Susan" // : String = "Susan" - |val greeting = s"Hello $name" // : String = "Hello Susan" - |println(greeting + "\nHow are you?") // Hello Susan… - |1.to(10).toVector // : Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - |val List(a, b) = List(42, 10) // a: Int = 42, b: Int = 10 + |val name = "Susan"/* // : String = "Susan"*/ + |val greeting = s"Hello $name"/* // : String = "Hello Susan"*/ + |println(greeting + "\nHow are you?")/* // Hello Susan...*/ + |1.to(10).toVector/* // : Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)*/ + |val List(a, b) = List(42, 10)/* // a: Int = 42, b: Int = 10*/ |""".stripMargin, Map( "3" -> """|import java.nio.file.Files - |val name = "Susan" // : String = Susan - |val greeting = s"Hello $name" // : String = Hello Susan - |println(greeting + "\nHow are you?") // Hello Susan… - |1.to(10).toVector // : Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - |val List(a, b) = List(42, 10) // a: Int = 42, b: Int = 10 - |given str: String = "" + |val name = "Susan"/* // : String = Susan*/ + |val greeting = s"Hello $name"/* // : String = Hello Susan*/ + |println(greeting + "\nHow are you?")/* // Hello Susan...*/ + |1.to(10).toVector/* // : Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)*/ + |val List(a, b) = List(42, 10)/* // a: Int = 42, b: Int = 10*/ |""".stripMargin ), scalaVersion, @@ -179,85 +177,29 @@ abstract class BaseWorksheetLspSuite( ) _ <- server.didOpen("a/src/main/scala/Main.worksheet.sc") _ = assertNoDiagnostics() - _ = assertNoDiff( - client.syntheticDecorations, - getExpected( - """|import java.nio.file.Files - |val name = "Susan" // : String = "Susan" - |val greeting = s"Hello $name" // : String = "Hello Susan" - |println(greeting + "\nHow are you?") // Hello Susan… - |1.to(10).toVector // : Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - |val List(a, b) = List(42, 10) // a: Int = 42, b: Int = 10 - |""".stripMargin, - Map( - "3" -> - """|import java.nio.file.Files - |val name = "Susan" // : String = Susan - |val greeting = s"Hello $name" // : String = Hello Susan - |println(greeting + "\nHow are you?") // Hello Susan… - |1.to(10).toVector // : Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - |val List(a, b) = List(42, 10) // a: Int = 42, b: Int = 10 - |""".stripMargin - ), - scalaVersion, - ), - ) - _ = assertNoDiff( - client.syntheticDecorationHoverMessage, + _ <- server.assertInlayHints( + "a/src/main/scala/Main.worksheet.sc", getExpected( """|import java.nio.file.Files - |val name = "Susan" - |```scala - |name: String = "Susan" - |``` - |val greeting = s"Hello $name" - |```scala - |greeting: String = "Hello Susan" - |``` - |println(greeting + "\nHow are you?") - |```scala - |// Hello Susan - |// How are you? - |``` - |1.to(10).toVector - |```scala - |res1: Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - |``` - |val List(a, b) = List(42, 10) - |```scala - |a: Int = 42 - |b: Int = 10 - |``` + |val name = "Susan"/* // : String = "Susan"| name: String = "Susan" |*/ + |val greeting = s"Hello $name"/* // : String = "Hello Susan"| greeting: String = "Hello Susan" |*/ + |println(greeting + "\nHow are you?")/* // Hello Susan...| // Hello Susan\n// How are you? |*/ + |1.to(10).toVector/* // : Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)| res1: Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) |*/ + |val List(a, b) = List(42, 10)/* // a: Int = 42, b: Int = 10| a: Int = 42\nb: Int = 10 |*/ |""".stripMargin, Map( "3" -> """|import java.nio.file.Files - |val name = "Susan" - |```scala - |name: String = Susan - |``` - |val greeting = s"Hello $name" - |```scala - |greeting: String = Hello Susan - |``` - |println(greeting + "\nHow are you?") - |```scala - |// Hello Susan - |// How are you? - |``` - |1.to(10).toVector - |```scala - |res1: Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - |``` - |val List(a, b) = List(42, 10) - |```scala - |a: Int = 42 - |b: Int = 10 - |``` + |val name = "Susan"/* // : String = Susan| name: String = Susan |*/ + |val greeting = s"Hello $name"/* // : String = Hello Susan| greeting: String = Hello Susan |*/ + |println(greeting + "\nHow are you?")/* // Hello Susan...| // Hello Susan\n// How are you? |*/ + |1.to(10).toVector/* // : Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)| res1: Vector[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) |*/ + |val List(a, b) = List(42, 10)/* // a: Int = 42, b: Int = 10| a: Int = 42\nb: Int = 10 |*/ |""".stripMargin ), scalaVersion, ), + withTooltip = true, ) } yield () } @@ -266,6 +208,7 @@ abstract class BaseWorksheetLspSuite( cleanWorkspace() val cancelled = Promise[Unit]() client.onWorkDoneProgressStart = { (message, cancelParams) => + scribe.info(message) if (message.startsWith("Evaluating worksheet")) { cancelled.trySuccess(()) server.fullServer.didCancelWorkDoneProgress(cancelParams) @@ -283,18 +226,20 @@ abstract class BaseWorksheetLspSuite( |""".stripMargin ) _ <- server.didOpen("a/src/main/scala/Main.worksheet.sc") - _ <- cancelled.future - _ = client.onWorkDoneProgressStart = (_, _) => {} + _ <- cancelled.future.withTimeout(10.seconds) + _ = client.onWorkDoneProgressStart = (message, _) => { + scribe.info(message) + } _ <- server.didSave("a/src/main/scala/Main.worksheet.sc")( _.replace("Stream", "// Stream") ) _ <- server.didSave("a/src/main/scala/Main.worksheet.sc")( _.replace("42", "43") ) - _ = assertNoDiff( - client.syntheticDecorations, + _ <- server.assertInlayHints( + "a/src/main/scala/Main.worksheet.sc", """| - |println(43) // 43 + |println(43)/* // 43*/ |// Stream.from(10).last |""".stripMargin, ) @@ -314,10 +259,9 @@ abstract class BaseWorksheetLspSuite( |""".stripMargin ) _ <- server.didOpen("a/src/main/scala/Main.worksheet.sc") - _ = assertNoDiff( - client.syntheticDecorations, - """| - |val x = 42 // : Int = 42 + _ <- server.assertInlayHints( + "a/src/main/scala/Main.worksheet.sc", + """|val x = 42/* // : Int = 42*/ |throw new RuntimeException("boom") |""".stripMargin, ) @@ -372,10 +316,10 @@ abstract class BaseWorksheetLspSuite( _ <- server.didOpen("b/src/main/scala/core/Lib2.scala") _ <- server.didOpen("b/src/main/scala/foo/Main.worksheet.sc") _ = assertNoDiagnostics() - _ = assertNoDiff( - client.workspaceDecorations("b/src/main/scala/foo/Main.worksheet.sc"), - """|println(core.Lib) // Lib - |println(core.Lib2) // Lib2 + _ <- server.assertInlayHints( + "b/src/main/scala/foo/Main.worksheet.sc", + """|println(core.Lib)/* // Lib*/ + |println(core.Lib2)/* // Lib2*/ |""".stripMargin, ) } yield () @@ -400,8 +344,13 @@ abstract class BaseWorksheetLspSuite( ) // completions work despite error _ = assertNoDiff(identity, "identity[A](x: A): A") - // decorations do not appear for non ".worksheet.sc" files. - _ = assertNoDiff(client.syntheticDecorations, "") + // worksheet evaluations do not appear for non ".worksheet.sc" files. + _ <- server.assertInlayHints( + "b/src/main/scala/foo/Main.worksheet.sc", + """|identity(42) + |val x: Int = "" + |""".stripMargin, + ) } yield () } @@ -463,20 +412,20 @@ abstract class BaseWorksheetLspSuite( _ <- server.didOpen("a/src/main/scala/a/Util.scala") _ <- server.didOpen("a/src/main/scala/a/Main.worksheet.sc") _ = assertNoDiagnostics() - _ = assertNoDiff( - client.workspaceDecorations("a/src/main/scala/a/Main.worksheet.sc"), + _ <- server.assertInlayHints( + "a/src/main/scala/a/Main.worksheet.sc", """ - |a.Util.increase(1) // : Int = 2 + |a.Util.increase(1)/* // : Int = 2*/ |""".stripMargin, ) _ <- server.didSave("a/src/main/scala/a/Util.scala")( _.replace("n + 1", "n + 2") ) _ <- server.didSave("a/src/main/scala/a/Main.worksheet.sc")(identity) - _ = assertNoDiff( - client.workspaceDecorations("a/src/main/scala/a/Main.worksheet.sc"), + _ <- server.assertInlayHints( + "a/src/main/scala/a/Main.worksheet.sc", """ - |a.Util.increase(1) // : Int = 3 + |a.Util.increase(1)/* // : Int = 3*/ |""".stripMargin, ) } yield () diff --git a/tests/unit/src/main/scala/tests/TestingServer.scala b/tests/unit/src/main/scala/tests/TestingServer.scala index eca29050410..931691c2da6 100644 --- a/tests/unit/src/main/scala/tests/TestingServer.scala +++ b/tests/unit/src/main/scala/tests/TestingServer.scala @@ -1455,11 +1455,20 @@ final case class TestingServer( filename: String, expected: String, root: AbsolutePath = workspace, + withTooltip: Boolean = false, + postprocessObtained: String => String = identity, )(implicit location: munit.Location ): Future[Unit] = { val fileContent = TestInlayHints.removeInlayHints(expected) - assertInlayHints(filename, fileContent, expected, root) + assertInlayHints( + filename, + fileContent, + expected, + root, + withTooltip, + postprocessObtained, + ) } def assertInlayHints( @@ -1467,6 +1476,8 @@ final case class TestingServer( fileContent: String, expected: String, root: AbsolutePath, + withTooltip: Boolean, + postprocessObtained: String => String, )(implicit location: munit.Location ): Future[Unit] = { @@ -1474,7 +1485,9 @@ final case class TestingServer( hints <- inlayHints(filename, fileContent, root) } yield { Assertions.assertNoDiff( - TestInlayHints.applyInlayHints(fileContent, hints), + postprocessObtained( + TestInlayHints.applyInlayHints(fileContent, hints, withTooltip) + ), expected, ) } @@ -1485,6 +1498,7 @@ final case class TestingServer( fileContent: String, root: AbsolutePath = workspace, ): Future[List[l.InlayHint]] = { + Debug.printEnclosing(filename) val path = root.resolve(filename) val input = m.Input.String(fileContent) path.touch() diff --git a/tests/unit/src/test/scala/tests/inlayHints/InlayHintsLspSuite.scala b/tests/unit/src/test/scala/tests/inlayHints/InlayHintsLspSuite.scala index ba383e286ad..619b0d3c2cc 100644 --- a/tests/unit/src/test/scala/tests/inlayHints/InlayHintsLspSuite.scala +++ b/tests/unit/src/test/scala/tests/inlayHints/InlayHintsLspSuite.scala @@ -255,10 +255,11 @@ class InlayHintsLspSuite _ <- server.assertInlayHints( "a/Main.worksheet.sc", """|def method(implicit str: String) = str + str - |implicit val name: String = "Susan".stripMargin - |val greeting = s"Hello $$name" - |method + |implicit val name: String = "Susan".stripMargin/* // : String = "Susan"| name: String = "Susan" |*/ + |val greeting = s"Hello $$name"/* // : String = "Hello $name"| greeting: String = "Hello $name" |*/ + |method/* // : String = "SusanSusan"| res0: String = "SusanSusan" |*/ |""".stripMargin, + withTooltip = true, ) _ <- server.didChangeConfiguration( """|{"inlayHints": { @@ -272,9 +273,9 @@ class InlayHintsLspSuite _ <- server.assertInlayHints( "a/Main.worksheet.sc", """|def method(implicit str: String)/*: String<>*/ = str + str - |implicit val name: String = /*augmentString<>(*/"Susan"/*)*/.stripMargin - |val greeting/*: String<>*/ = s"Hello $$name" - |method/*(name<<(1:13)>>)*/ + |implicit val name: String = /*augmentString<>(*/"Susan"/*)*/.stripMargin/* // : String = "Susan"*/ + |val greeting/*: String<>*/ = s"Hello $$name"/* // : String = "Hello $name"*/ + |method/*(name<<(1:13)>>)*//* // : String = "SusanSusan"*/ |""".stripMargin, ) } yield () diff --git a/tests/unit/src/test/scala/tests/worksheets/WorksheetLspSuite.scala b/tests/unit/src/test/scala/tests/worksheets/WorksheetLspSuite.scala index fde4bd34571..4d868475816 100644 --- a/tests/unit/src/test/scala/tests/worksheets/WorksheetLspSuite.scala +++ b/tests/unit/src/test/scala/tests/worksheets/WorksheetLspSuite.scala @@ -56,16 +56,16 @@ class WorksheetLspSuite extends tests.BaseWorksheetLspSuite(V.scala213) { _ <- server.didOpen("scalatags/Text.scala") _ = assertNoDiff(identity, "render: String") _ = assertNoDiagnostics() - _ = assertNoDiff( - client.workspaceDecorations(path), + _ <- server.assertInlayHints( + path, """|import $dep.`com.lihaoyi::scalatags:0.9.0` |import scalatags.Text.all._ |val htmlFile = html( | body( | p("This is a big paragraph of text") | ) - |) // : scalatags.Text.TypedTag[String] = TypedTag( tag = "html", modifiers = List( ArraySeq( TypedTag( tag = "body", modifie… - |htmlFile.render // : String = "

This is a big paragraph of text

" + |)/* // : scalatags.Text.TypedTag[String] = TypedTag( tag = "html", modifiers = List( ArraySeq( TypedTag( tag = "body", modifie…*/ + |htmlFile.render/* // : String = "

This is a big paragraph of text

"*/ |""".stripMargin, ) } yield () @@ -111,9 +111,9 @@ class WorksheetLspSuite extends tests.BaseWorksheetLspSuite(V.scala213) { |""".stripMargin ) _ <- server.didOpen(path) - _ = assertNoDiff( - client.syntheticDecorations, - "new java.sql.Date(100L) // : java.sql.Date = 1970-01-01", + _ <- server.assertInlayHints( + path, + "new java.sql.Date(100L)/* // : java.sql.Date = 1970-01-01*/", ) } yield () } @@ -148,9 +148,8 @@ class WorksheetLspSuite extends tests.BaseWorksheetLspSuite(V.scala213) { |""".stripMargin ) _ <- server.didOpen(path) - _ = assertNoDiff( - // it seems that part of the string is always different, so let's remove it - client.syntheticDecorations.replaceAll(".out\\(.*", ".out(..."), + _ <- server.assertInlayHints( + path, """|import $dep.`com.typesafe.akka::akka-stream:2.6.13` | |import akka.actor.ActorSystem @@ -162,11 +161,12 @@ class WorksheetLspSuite extends tests.BaseWorksheetLspSuite(V.scala213) { |import scala.concurrent.duration.DurationInt | | - |implicit val system: ActorSystem = ActorSystem("QuickStart") // : ActorSystem = akka://QuickStart - |val source: Source[Int, NotUsed] = Source(1 to 2) // : Source[Int, NotUsed] = Source(SourceShape(StatefulMapConcat.out(... - |val future = source.runWith(Sink.foreach(_ => ())) // : concurrent.Future[akka.Done] = Future() - |Await.result(future, 3.seconds) // : akka.Done = Done + |implicit val system: ActorSystem = ActorSystem("QuickStart")/* // : ActorSystem = akka://QuickStart*/ + |val source: Source[Int, NotUsed] = Source(1 to 2)/* // : Source[Int, NotUsed] = Source(SourceShape(StatefulMapConcat.out(...*/ + |val future = source.runWith(Sink.foreach(_ => ()))/* // : concurrent.Future[akka.Done] = Future()*/ + |Await.result(future, 3.seconds)/* // : akka.Done = Done*/ |""".stripMargin, + postprocessObtained = _.replaceAll(".out\\(.*", ".out(...*/"), ) } yield () }