Skip to content

Commit 3ae87d4

Browse files
committed
use new extractors for trees supporting clause interleaving
scalameta/scalameta#2869 scalameta/scalameta#3067
1 parent d750ea5 commit 3ae87d4

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

docs/developers/patch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ The `replaceTree()` patch is a convenience operator for `removeTokens` and
118118

119119
```scala mdoc
120120
doc.tree.collect {
121-
case println @ Term.Apply(Name("println"), _) =>
121+
case println @ Term.Apply.After_4_6_0(Name("println"), _) =>
122122
Patch.replaceTree(println, "print(40 + 2)")
123123
}.showDiff()
124124
```
@@ -178,7 +178,7 @@ case class Println(position: Position) extends Diagnostic {
178178
def message = "Use loggers instead of println"
179179
}
180180
doc.tree.collect {
181-
case println @ Term.Apply(Term.Name("println"), _) =>
181+
case println @ Term.Apply.After_4_6_0(Term.Name("println"), _) =>
182182
Patch.lint(Println(println.pos))
183183
}.showLints()
184184
```

docs/developers/semantic-tree.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ of those inferred `.apply` method calls.
8787

8888
```scala mdoc
8989
doc.tree.traverse {
90-
case Term.Apply(add @ q"add", List(q"2")) =>
90+
case Term.Apply.After_4_6_0(add @ q"add", Term.ArgClause(List(q"2"), _)) =>
9191
println("add(2)")
9292
println("synthetic = " + add.synthetics)
9393
println("symbol = " + add.synthetics.flatMap(_.symbol).structure)
9494
println("structure = " + add.synthetics.structure)
95-
case Term.ApplyType(option @ q"Option", List(t"Int")) =>
95+
case Term.ApplyType.After_4_6_0(option @ q"Option", Term.ArgClause(List(t"Int"), _)) =>
9696
println("Option[Int]")
9797
println("synthetic = " + option.synthetics)
9898
println("symbol = " + option.synthetics.flatMap(_.symbol).structure)
@@ -150,7 +150,7 @@ of infix operators.
150150

151151
```scala mdoc
152152
doc.tree.traverse {
153-
case concat @ Term.ApplyInfix(_, Term.Name("++"), _, _) =>
153+
case concat @ Term.ApplyInfix.After_4_6_0(_, Term.Name("++"), _, _) =>
154154
println(".syntheticOperators = " + concat.syntheticOperators)
155155
println(".structure = " + concat.syntheticOperators.structure)
156156
}

docs/developers/symbol-information.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ node.
5656

5757
```scala mdoc
5858
doc.tree.collect {
59-
case apply @ Term.Apply(println @ Term.Name("println"), _) =>
59+
case apply @ Term.Apply.After_4_6_0(println @ Term.Name("println"), _) =>
6060
(apply.syntax, println.symbol)
6161
}
6262
```

docs/developers/symbol-matcher.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pattern.
161161

162162
```scala mdoc
163163
doc.tree.traverse {
164-
case function @ Term.Apply(successObject(_), List(argument)) =>
164+
case function @ Term.Apply.After_4_6_0(successObject(_), List(argument)) =>
165165
println(function.pos.formatMessage("info",
166166
s"Argument of Success is $argument"))
167167
}

0 commit comments

Comments
 (0)