File tree Expand file tree Collapse file tree 8 files changed +39
-29
lines changed Expand file tree Collapse file tree 8 files changed +39
-29
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ project/boot/
12
12
project /plugins /project /
13
13
project /local-plugins.sbt
14
14
.history
15
+ .bsp
15
16
16
17
# Scala-IDE specific
17
18
.scala_dependencies
Original file line number Diff line number Diff line change 1
- val dottyVersion = " 0.27.0-RC1 "
1
+ val dottyVersion = " 3.0.0-M2 "
2
2
3
3
lazy val lib = project
4
4
.in(file(" lib" ))
@@ -20,7 +20,7 @@ lazy val inspector = project
20
20
scalaVersion := dottyVersion,
21
21
22
22
libraryDependencies ++= Seq (
23
- " ch.epfl.lamp " %% " dotty -tasty-inspector" % dottyVersion,
23
+ " org.scala-lang " %% " scala3 -tasty-inspector" % dottyVersion,
24
24
" com.novocode" % " junit-interface" % " 0.11" % " test"
25
25
)
26
26
)
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+
2
+ package inspector
3
+
4
+ import scala .quoted ._
5
+
6
+ import scala .tasty .inspector .TastyInspector
7
+
8
+ object Inspector {
9
+
10
+ def showCodeOf (tastyFile : String ): String = {
11
+ var tastyStr : String = null
12
+ val inspector = new TastyInspector {
13
+ protected def processCompilationUnit (using Quotes )(root : quotes.reflect.Tree ): Unit = {
14
+ import quotes .reflect ._
15
+ val projectDir = new java.io.File ( " ." ).getCanonicalPath() + java.io.File .separator // To cleanup the paths in @SourceFile
16
+ tastyStr = root.show.replace(projectDir, " " )
17
+ }
18
+ }
19
+ inspector.inspectTastyFiles(List (tastyFile))
20
+ tastyStr
21
+ }
22
+
23
+ }
Original file line number Diff line number Diff line change
1
+ package inspector
2
+
3
+ import scala .quoted ._
4
+
5
+ @ main def run =
6
+ val tastyFile = " lib/target/scala-3.0.0-M2/classes/lib/Greetings.tasty"
7
+ val tastyContents = Inspector .showCodeOf(tastyFile)
8
+ println(tastyContents)
9
+
Original file line number Diff line number Diff line change
1
+ package inspector
1
2
2
3
import scala .tasty .inspector ._
3
4
@@ -13,7 +14,7 @@ class InspectorTest {
13
14
| def hello(name: scala.Predef.String): scala.Predef.String = "Hello ".+(name)
14
15
| }
15
16
|}""" .stripMargin,
16
- Inspector .showCodeOf(" lib. Greetings" )
17
+ Inspector .showCodeOf(" lib/target/scala-3.0.0-M2/classes/lib/ Greetings.tasty " )
17
18
)
18
19
19
20
}
Original file line number Diff line number Diff line change 1
- sbt.version =1.3.13
1
+ sbt.version =1.4.4
Original file line number Diff line number Diff line change 1
- addSbtPlugin(" ch.epfl.lamp" % " sbt-dotty" % " 0.4.2 " )
1
+ addSbtPlugin(" ch.epfl.lamp" % " sbt-dotty" % " 0.4.6 " )
You can’t perform that action at this time.
0 commit comments