From 848aedacca225ffd2e08219cfe1141b4382aaee5 Mon Sep 17 00:00:00 2001 From: Quentin Bernet Date: Sat, 1 Apr 2023 08:10:54 +0200 Subject: [PATCH 1/2] Add explanation of, and link to TASTyViz (#17193) --- .../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..33fd8fc8c8df 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 3a450422e60a5feefd5350b76d4b46207cc44fea Mon Sep 17 00:00:00 2001 From: liang3zy22 <35164941+liang3zy22@users.noreply.github.com> Date: Wed, 5 Apr 2023 15:16:20 +0800 Subject: [PATCH 2/2] Update union-types.md and lazy-vals-init.md Update union-types.md to improve readability. Update lazy-vals-init.md to fix invalid link issue. --- docs/_docs/reference/changed-features/lazy-vals-init.md | 5 ++--- docs/_docs/reference/new-types/union-types.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/_docs/reference/changed-features/lazy-vals-init.md b/docs/_docs/reference/changed-features/lazy-vals-init.md index 131ac6ad7bb2..265f267e9857 100644 --- a/docs/_docs/reference/changed-features/lazy-vals-init.md +++ b/docs/_docs/reference/changed-features/lazy-vals-init.md @@ -4,8 +4,7 @@ title: Lazy Vals Initialization nightlyOf: https://docs.scala-lang.org/scala3/reference/changed-features/lazy-vals-init.html --- -Scala 3 implements [Version 6](https://docs.scala-lang.org/sips/improved-lazy-val-initialization.html#version-6---no-synchronization-on-this-and-concurrent-initialization-of-fields) -of the [SIP-20] improved lazy vals initialization proposal. +Scala 3 implements Version 6 of the [SIP-20] improved lazy vals initialization proposal. ## Motivation @@ -77,4 +76,4 @@ recursive lazy vals is undefined (initialization may result in a deadlock). * [SIP-20] -[SIP-20]: https://docs.scala-lang.org/sips/improved-lazy-val-initialization.html +[SIP-20]: https://github.com/scala/improvement-proposals/pull/19 diff --git a/docs/_docs/reference/new-types/union-types.md b/docs/_docs/reference/new-types/union-types.md index ebc4565e36fb..76c0ac6e674c 100644 --- a/docs/_docs/reference/new-types/union-types.md +++ b/docs/_docs/reference/new-types/union-types.md @@ -4,7 +4,7 @@ title: "Union Types" nightlyOf: https://docs.scala-lang.org/scala3/reference/new-types/union-types.html --- -A union type `A | B` has as values all values of type `A` and also all values of type `B`. +A union type `A | B` includes all values of both types. ```scala