Skip to content

Commit

Permalink
Add types to worksheet values
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Aug 13, 2020
1 parent 10ebac7 commit 4106e18
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Expand Up @@ -181,7 +181,7 @@ lazy val V = new {
val sbtBloop = bloop
val gradleBloop = bloop
val mavenBloop = bloop
val mdoc = "2.2.4"
val mdoc = "2.2.5"
val scalafmt = "2.6.4"
val munit = "0.7.10"
// List of supported Scala versions in SemanticDB. Needs to be manually updated
Expand Down
32 changes: 15 additions & 17 deletions tests/unit/src/main/scala/tests/BaseWorksheetLspSuite.scala
Expand Up @@ -56,8 +56,8 @@ abstract class BaseWorksheetLspSuite(scalaVersion: String)
_ = assertNoDiagnostics()
_ = assertNoDiff(
client.workspaceDecorations,
"""|identity(42) // 42
|val name = sourcecode.Name.generate.value // "name"
"""|identity(42) // : Int = 42
|val name = sourcecode.Name.generate.value // : String = "name"
|""".stripMargin
)
} yield ()
Expand Down Expand Up @@ -130,13 +130,12 @@ abstract class BaseWorksheetLspSuite(scalaVersion: String)
_ = assertNoDiagnostics()
_ = assertNoDiff(
client.workspaceDecorations,
"""|
|import java.nio.file.Files
|val name = "Susan" // "Susan"
|val greeting = s"Hello $name" // "Hello Susan"
"""|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(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
|val List(a, b) = List(42, 10) // a=42, b=10
|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
)
} yield ()
Expand All @@ -161,13 +160,12 @@ abstract class BaseWorksheetLspSuite(scalaVersion: String)
_ = assertNoDiagnostics()
_ = assertNoDiff(
client.workspaceDecorations,
"""|
|import java.nio.file.Files
|val name = "Susan" // "Susan"
|val greeting = s"Hello $name" // "Hello Susan"
"""|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(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
|val List(a, b) = List(42, 10) // a=42, b=10
|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
)
_ = assertNoDiff(
Expand Down Expand Up @@ -250,7 +248,7 @@ abstract class BaseWorksheetLspSuite(scalaVersion: String)
_ = assertNoDiff(
client.workspaceDecorations,
"""|
|val x = 42 // 42
|val x = 42 // : Int = 42
|throw new RuntimeException("boom")
|""".stripMargin
)
Expand Down Expand Up @@ -358,7 +356,7 @@ abstract class BaseWorksheetLspSuite(scalaVersion: String)
_ = assertNoDiff(
client.workspaceDecorations,
"""
|a.Util.increase(1) // 2
|a.Util.increase(1) // : Int = 2
|""".stripMargin
)
_ <- server.didSave("a/src/main/scala/a/Util.scala")(
Expand All @@ -368,7 +366,7 @@ abstract class BaseWorksheetLspSuite(scalaVersion: String)
_ = assertNoDiff(
client.workspaceDecorations,
"""
|a.Util.increase(1) // 3
|a.Util.increase(1) // : Int = 3
|""".stripMargin
)
} yield ()
Expand Down

0 comments on commit 4106e18

Please sign in to comment.