Skip to content

Commit b607e65

Browse files
committed
Make sure that our DRIs are unique
1 parent 7d9d0de commit b607e65

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

scala3doc/src/dotty/dokka/tasty/BasicSupport.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ trait BasicSupport:
4545
path.map(TastyDocumentableSource(_, sym.pos.startLine))
4646

4747
def getAnnotations(): List[Annotation] =
48-
sym.annots.filterNot(_.symbol.packageName.startsWith("scala.annotation.internal")).map(parseAnnotation).reverse
48+
sym.annots.filterNot(_.symbol.packageName.startsWith("scala.annotation.internal")).map(parseAnnotation).reverse
4949

5050

scala3doc/src/dotty/dokka/tasty/SymOps.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ class SymOps[Q <: Quotes](val q: Q):
9494

9595
// TODO #22 make sure that DRIs are unique plus probably reuse semantic db code?
9696
def dri: DRI =
97-
if sym == Symbol.noSymbol then emptyDRI else if sym.isValDef && sym.moduleClass.exists then sym.moduleClass.dri else
97+
if sym == Symbol.noSymbol then emptyDRI
98+
else if sym.isValDef && sym.moduleClass.exists then sym.moduleClass.dri
99+
else
98100
val pointsTo =
99101
if (!sym.isTypeDef) PointingToDeclaration.INSTANCE
100102
else PointingToGenericParameters(sym.owner.typeMembers.indexOf(sym))
@@ -108,8 +110,10 @@ class SymOps[Q <: Quotes](val q: Q):
108110
sym.packageName,
109111
sym.topLevelEntryName.orNull, // TODO do we need any of this fields?
110112
method.map(s => new org.jetbrains.dokka.links.Callable(s.name, null, JList())).orNull,
111-
pointsTo, // TODO different targets?
112-
s"${sym.show}/${sym.signature.resultSig}/[${sym.signature.paramSigs.mkString("/")}]"
113+
pointsTo,
114+
// sym.show returns the same signature for def << = 1 and def >> = 2.
115+
// For some reason it contains `$$$` instrad of symbol name
116+
s"${sym.name}${sym.show}/${sym.signature.resultSig}/[${sym.signature.paramSigs.mkString("/")}]"
113117
)
114118

115119
private val emptyDRI = DRI.Companion.getTopLevel

0 commit comments

Comments
 (0)