Skip to content

Commit 123ab59

Browse files
committed
Clenup Scaladoc2AnchorCreator
1 parent 6a75146 commit 123ab59

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

scaladoc/src/dotty/tools/scaladoc/tasty/Scaladoc2AnchorCreator.scala

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ import dotty.tools.scaladoc.util.Escape._
66
import scala.util.matching.Regex
77

88
trait Scaladoc2AnchorCreator:
9-
self: SymOps[_] =>
109

11-
import self.q.reflect._
12-
13-
implicit private val printer: Printer[Tree] = Printer.TreeShortCode
14-
15-
def getScaladoc2Type(t: Tree) = {
16-
(t match {
17-
case d: DefDef => d.show.split("def", 2)(1)
18-
case t: TypeDef => t.show.split("type", 2)(1)
19-
case v: ValDef => v.show.split("val|var", 2)(1)
20-
}).replace(" ","")
21-
}
10+
def getScaladoc2Type(using Quotes)(t: quotes.reflect.Tree) =
11+
import quotes.reflect.*
12+
val spliter = t match
13+
case d: DefDef => "def"
14+
case t: TypeDef => "type"
15+
case v: ValDef => "val|var"
16+
t.show(using Printer.TreeShortCode).split(spliter, 2)(1).replace(" ","")

0 commit comments

Comments
 (0)