@@ -30,17 +30,22 @@ case class DokkaTastyInspector(parser: Parser)(using ctx: DocContext) extends Do
30
30
private val topLevels = Seq .newBuilder[Documentable ]
31
31
32
32
def processCompilationUnit (using q : Quotes )(root : q.reflect.Tree ): Unit =
33
- val parser = new TastyParser (q, this )
34
-
35
- def driFor (link : String ): Option [DRI ] =
36
- val symOps = new SymOps [q.type ](q)
37
- import symOps ._
38
- Try (QueryParser (link).readQuery()).toOption.flatMap(q =>
39
- MemberLookup .lookupOpt(q, None ).map{ case (sym, _) => sym.dri}
40
- )
33
+ // NOTE we avoid documenting definitions in the magical stdLibPatches directory;
34
+ // the symbols there are "patched" through dark Dotty magic onto other stdlib
35
+ // definitions, so if we documented their origin, we'd get defs with duplicate DRIs
36
+ if ! root.symbol.show.startsWith(" scala.runtime.stdLibPatches" ) then
37
+ val parser = new TastyParser (q, this )
38
+
39
+ def driFor (link : String ): Option [DRI ] =
40
+ val symOps = new SymOps [q.type ](q)
41
+ import symOps ._
42
+ Try (QueryParser (link).readQuery()).toOption.flatMap(q =>
43
+ MemberLookup .lookupOpt(q, None ).map{ case (sym, _) => sym.dri}
44
+ )
41
45
42
- ctx.staticSiteContext.foreach(_.memberLinkResolver = driFor)
43
- topLevels ++= parser.parseRootTree(root.asInstanceOf [parser.qctx.reflect.Tree ])
46
+ ctx.staticSiteContext.foreach(_.memberLinkResolver = driFor)
47
+ topLevels ++= parser.parseRootTree(root.asInstanceOf [parser.qctx.reflect.Tree ])
48
+ end processCompilationUnit
44
49
45
50
def result (): List [DPackage ] =
46
51
topLevels.clear()
0 commit comments