Skip to content

Commit 902bd21

Browse files
committed
Update showExtractors to Printer.TreeStructure
1 parent 8631782 commit 902bd21

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/docs/reference/metaprogramming/tasty-reflect.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ def natConstImpl(x: Expr[Int])(using Quotes): Expr[Int] = {
5858
}
5959
```
6060

61-
To easily know which extractors are needed, the `showExtractors` method on a
62-
`quotes.reflect.Term` returns the string representation of the extractors.
61+
To easily know which extractors are needed using the `Printer.TreeStructure.show` which returns the string representation the structure of the tree. Other printers can also be found in the `Printer` module.
62+
63+
```scala
64+
xTree.show(using Printer.TreeStructure)
65+
// or
66+
Printer.TreeStructure.show(xTree)
67+
```
68+
6369

6470
The methods `quotes.reflect.Term.{asExpr, asExprOf}` provide a way to go back to a `quoted.Expr`.
6571
Note that `asExpr` returns a `Expr[Any]`.

0 commit comments

Comments
 (0)