Skip to content

Commit 9eb08ec

Browse files
committed
Fix the scala3-tasty-inspector dependency in tasty-inspect.md
1 parent 4f93df0 commit 9eb08ec

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: "TASTy Inspection"
44
---
55

66
```scala
7-
libraryDependencies += "ch.epfl.lamp" %% "scala3-tasty-inspector" % scalaVersion.value
7+
libraryDependencies += "org.scala-lang" %% "scala3-tasty-inspector" % scalaVersion.value
88
```
99

1010
TASTy files contain the full typed tree of a class including source positions
@@ -13,7 +13,6 @@ information from the code. To avoid the hassle of working directly with the TAST
1313
file we provide the `TastyInspector` which loads the contents and exposes it
1414
through the TASTy reflect API.
1515

16-
1716
## Inspecting TASTy files
1817

1918
To inspect the TASTy Reflect trees of a TASTy file a consumer can be defined in
@@ -46,10 +45,12 @@ scalac -d out Test.scala
4645
scala -with-compiler -classpath out Test
4746
```
4847

49-
5048
## Template project
49+
5150
Using sbt version `1.1.5+`, do:
52-
```
51+
52+
```shell
5353
sbt new scala/scala3-tasty-inspector.g8
5454
```
55+
5556
in the folder where you want to clone the template.

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ generation of code will be type-correct. Using TASTy Reflect will break these
1818
guarantees and may fail at macro expansion time, hence additional explicit
1919
checks must be done.
2020

21-
To provide reflection capabilities in macros we need to add an implicit
22-
parameter of type `scala.quoted.Quotes` and import `quotes.reflect._` from it in
23-
the scope where it is used.
21+
To provide reflection capabilities in macros we need to add an implicit parameter
22+
of type `scala.quoted.Quotes` and import `quotes.reflect._` from it in the scope
23+
where it is used.
2424

2525
```scala
2626
import scala.quoted._
@@ -103,9 +103,9 @@ of type `List[Symbol]` if we want to collect symbols). The code below, for
103103
example, collects the pattern variables of a tree.
104104

105105
```scala
106-
def collectPatternVariables(tree: Tree)(implicit ctx: Context): List[Symbol] =
106+
def collectPatternVariables(tree: Tree)(using ctx: Context): List[Symbol] =
107107
val acc = new TreeAccumulator[List[Symbol]]:
108-
def apply(syms: List[Symbol], tree: Tree)(implicit ctx: Context) = tree match
108+
def apply(syms: List[Symbol], tree: Tree)(using ctx: Context): List[Symbol] = tree match
109109
case Bind(_, body) => apply(tree.symbol :: syms, body)
110110
case _ => foldOver(syms, tree)
111111
acc(Nil, tree)

0 commit comments

Comments
 (0)