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