Skip to content

Commit 848aeda

Browse files
authored
Add explanation of, and link to TASTyViz (#17193)
1 parent a46d730 commit 848aeda

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

docs/_docs/reference/metaprogramming/tasty-inspect.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,33 @@ title: "TASTy Inspection"
44
nightlyOf: https://docs.scala-lang.org/scala3/reference/metaprogramming/tasty-inspect.html
55
---
66

7-
```scala
8-
libraryDependencies += "org.scala-lang" %% "scala3-tasty-inspector" % scalaVersion.value
9-
```
10-
117
TASTy files contain the full typed tree of a class including source positions
128
and documentation. This is ideal for tools that analyze or extract semantic
13-
information from the code. To avoid the hassle of working directly with the TASTy
9+
information from the code.
10+
11+
To avoid the hassle of working directly with the TASTy
1412
file we provide the `Inspector` which loads the contents and exposes it
1513
through the TASTy reflect API.
1614

17-
## Inspecting TASTy files
15+
We also showcase TASTyViz, a visualiser for tasty, useful for debugging and checking your understanding of TASTy
16+
17+
## TASTyViz
18+
19+
<!-- Keep synced with https://github.com/scala/docs.scala-lang/blob/main/scala3/guides/tasty-overview.md -->
20+
21+
TASTyViz is a tool to inspect TASTy files visually.
22+
At the time of writing, it is still in the early stages of developement, therefore you can expect missing functionality and less-than-ideal user experience, but it could still prove useful when debugging.
23+
You can check it out [here](https://github.com/shardulc/tastyviz).
24+
25+
## `Inspector`
26+
27+
`Inspector` is a tool which provides API access to TASTy.
28+
29+
You can add the depency to your sbt build like so:
30+
```scala
31+
libraryDependencies += "org.scala-lang" %% "scala3-tasty-inspector" % scalaVersion.value
32+
```
33+
1834

1935
To inspect the trees of a TASTy file a consumer can be defined in the following way.
2036

0 commit comments

Comments
 (0)