Skip to content

Commit

Permalink
Don't render the "$" for module
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Dedelweiss committed Apr 24, 2023
1 parent 083027e commit d26d076
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ trait ClassLikeSupport:
experimental: Option[Annotation] = None
) = Member(
name = symbol.normalizedName,
fullName = symbol.fullName,
fullName = symbol.normalizedFullName,
dri = symbol.dri,
kind = kind,
visibility = symbol.getVisibility(),
Expand Down
12 changes: 12 additions & 0 deletions scaladoc/src/dotty/tools/scaladoc/tasty/NameNormalizer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ object NameNormalizer {
val escaped = escapedName(constructorNormalizedName)
escaped
}

def ownerNameChain: List[String] = {
import reflect.*
if s.isNoSymbol then List.empty
else if s == defn.EmptyPackageClass then List.empty
else if s == defn.RootPackage then List.empty
else if s == defn.RootClass then List.empty
else s.owner.ownerNameChain :+ s.normalizedName
}

def normalizedFullName: String =
s.ownerNameChain.mkString(".")

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

Expand Down

0 comments on commit d26d076

Please sign in to comment.