From db24a71e24cc5a95d274c8d9803d3e862b744743 Mon Sep 17 00:00:00 2001 From: Quentin Bernet Date: Fri, 31 Mar 2023 15:21:41 +0200 Subject: [PATCH 1/2] Add explanation of, and link to TASTyViz Kin-PR to https://github.com/scala/docs.scala-lang/pull/2761 --- .../metaprogramming/tasty-inspect.md | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/_docs/reference/metaprogramming/tasty-inspect.md b/docs/_docs/reference/metaprogramming/tasty-inspect.md index e643775243e0..f81b99191f69 100644 --- a/docs/_docs/reference/metaprogramming/tasty-inspect.md +++ b/docs/_docs/reference/metaprogramming/tasty-inspect.md @@ -4,17 +4,33 @@ title: "TASTy Inspection" nightlyOf: https://docs.scala-lang.org/scala3/reference/metaprogramming/tasty-inspect.html --- -```scala -libraryDependencies += "org.scala-lang" %% "scala3-tasty-inspector" % scalaVersion.value -``` - TASTy files contain the full typed tree of a class including source positions and documentation. This is ideal for tools that analyze or extract semantic -information from the code. To avoid the hassle of working directly with the TASTy +information from the code. + +To avoid the hassle of working directly with the TASTy file we provide the `Inspector` which loads the contents and exposes it through the TASTy reflect API. -## Inspecting TASTy files +We also showcase TASTyViz, a visualiser for tasty, useful for debugging and checking your understanding of TASTy + +## TASTyViz + + + +TASTyViz is a tool to inspect TASTy files visually. +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. +You can check it out here: https://github.com/shardulc/tastyviz + +## `Inspector` + +`Inspector` is a tool which provides API access to TASTy. + +You can add the depency to your sbt build like so: +```scala +libraryDependencies += "org.scala-lang" %% "scala3-tasty-inspector" % scalaVersion.value +``` + To inspect the trees of a TASTy file a consumer can be defined in the following way. From e51294977cea51616eed94eeb65f157c8f5331a2 Mon Sep 17 00:00:00 2001 From: Quentin Bernet Date: Fri, 31 Mar 2023 16:55:37 +0200 Subject: [PATCH 2/2] Update docs/_docs/reference/metaprogramming/tasty-inspect.md Co-authored-by: Julien Richard-Foy --- docs/_docs/reference/metaprogramming/tasty-inspect.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/reference/metaprogramming/tasty-inspect.md b/docs/_docs/reference/metaprogramming/tasty-inspect.md index f81b99191f69..33fd8fc8c8df 100644 --- a/docs/_docs/reference/metaprogramming/tasty-inspect.md +++ b/docs/_docs/reference/metaprogramming/tasty-inspect.md @@ -20,7 +20,7 @@ We also showcase TASTyViz, a visualiser for tasty, useful for debugging and chec TASTyViz is a tool to inspect TASTy files visually. 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. -You can check it out here: https://github.com/shardulc/tastyviz +You can check it out [here](https://github.com/shardulc/tastyviz). ## `Inspector`