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
33import scala .quoted ._
44import scala .tasty .inspector .TastyInspector
55
6+ import scala .jdk .StreamConverters ._
7+
8+ import java .nio .file .{Path , Files , Paths , FileSystems }
9+
610object Main extends App {
711
812 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 ._
1116 val tastyStr = root.show
1217 println(tastyStr)
1318 }
1419 }
1520
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+ }
1733
1834}
You can’t perform that action at this time.
0 commit comments