File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
semanticdb/test/dotty/semanticdb Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,24 @@ class Tests {
25
25
26
26
/** TODO: Produce semanticdb from TASTy for this Scala source file. */
27
27
def getTastySemanticdb (scalaFile : Path ): s.TextDocument = {
28
- ???
28
+ val scalac = getScalacSemanticdb(scalaFile)
29
+ val pat = """ (.*)\.scala""" .r
30
+ val classpath = scalaFile.getParent().toString()
31
+ val modulename = sourceDirectory.relativize(scalaFile).getParent().getFileName().toString()
32
+ val sourcename =
33
+ scalaFile.toFile().getName().toString() match {
34
+ case pat(name) => name
35
+ case _ => " "
36
+ }
37
+ val _ = ConsumeTasty (classpath, (modulename + " ." + sourcename) :: Nil , new SemanticdbConsumer )
38
+ return s.TextDocument (text = scalac.text)
29
39
}
30
40
31
41
/** Fails the test if the s.TextDocument from tasty and semanticdb-scalac are not the same. */
32
42
def checkFile (filename : String ): Unit = {
33
43
val path = sourceDirectory.resolve(filename)
34
44
val scalac = getScalacSemanticdb(path)
35
- val tasty = s. TextDocument (text = scalac.text) // TODO: replace with ` getTastySemanticdb(path)`
45
+ val tasty = getTastySemanticdb(path)
36
46
val obtained = Semanticdbs .printTextDocument(tasty)
37
47
val expected = Semanticdbs .printTextDocument(scalac)
38
48
assertNoDiff(obtained, expected)
You can’t perform that action at this time.
0 commit comments