Skip to content

Commit 7d23506

Browse files
committed
Don't render the "$" for module
Change of how to correct the Issue - Add a new method "normalizedFullName" - Call the method "ClassLikeSupport" Add the ownerNameChain function - To erase the $ in all the hierarchy
1 parent 083027e commit 7d23506

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ trait ClassLikeSupport:
525525
experimental: Option[Annotation] = None
526526
) = Member(
527527
name = symbol.normalizedName,
528-
fullName = symbol.fullName,
528+
fullName = symbol.normalizedFullName,
529529
dri = symbol.dri,
530530
kind = kind,
531531
visibility = symbol.getVisibility(),

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ object NameNormalizer {
1717
val escaped = escapedName(constructorNormalizedName)
1818
escaped
1919
}
20+
21+
def ownerNameChain: List[String] = {
22+
import reflect.*
23+
s match
24+
case s: reflect.Symbol if s.isNoSymbol => List.empty
25+
case s: reflect.Symbol if s == defn.EmptyPackageClass => List.empty
26+
case s: reflect.Symbol if s == defn.RootPackage => List.empty
27+
case s: reflect.Symbol if s == defn.RootClass => List.empty
28+
case _ => s.owner.ownerNameChain :+ s.normalizedName
29+
}
30+
31+
def normalizedFullName: String =
32+
s.ownerNameChain.mkString(".")
2033

2134
private val ignoredKeywords: Set[String] = Set("this")
2235

0 commit comments

Comments
 (0)