File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
sbt-dotty/sbt-test/sbt-dotty/tasty-inspector-example-project/app Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,32 @@ package hello
3
3
import scala .quoted ._
4
4
import scala .tasty .inspector .TastyInspector
5
5
6
+ import scala .jdk .StreamConverters ._
7
+
8
+ import java .nio .file .{Path , Files , Paths , FileSystems }
9
+
6
10
object Main extends App {
7
11
8
12
val inspector = new TastyInspector {
9
- protected def processCompilationUnit (using QuoteContext )(root : qctx.tasty.Tree ): Unit = {
10
- import qctx .tasty ._
13
+ protected def processCompilationUnit (using QuoteContext )(root : qctx.reflect.Tree ): Unit = {
14
+
15
+ import qctx .reflect ._
11
16
val tastyStr = root.show
12
17
println(tastyStr)
13
18
}
14
19
}
15
20
16
- inspector.inspect(" " , List (" lib.Foo" ))
21
+ private def walk (f : Path ): LazyList [Path ] = Files .walk(f).toScala(LazyList )
22
+
23
+ locally {
24
+
25
+ val `lib/Foo.tasty` = FileSystems .getDefault.getPathMatcher(" glob:**/lib/Foo.tasty" )
26
+ val pwd = Paths .get(" " )
27
+
28
+ val tastyFiles = for p <- walk(pwd) if `lib/Foo.tasty`.matches(p) yield p.toString
29
+
30
+ inspector.inspectTastyFiles(List (tastyFiles.head))
31
+
32
+ }
17
33
18
34
}
You can’t perform that action at this time.
0 commit comments