All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dotty.tools.scaladoc.transformers.SealedMarksGraphTransformer.scala Maven / Gradle / Ivy

There is a newer version: 3.6.0-RC1-bin-20240917-6e852d2-NIGHTLY
Show newest version
package dotty.tools.scaladoc
package transformers


class SealedMarksGraphTransformer(using context: DocContext) extends (Module => Module):
  override def apply(original: Module): Module =
    val sealedRelations = getSealedRelations(original.rootPackage)
    original.updateMembers { m =>
      m.copy(graph = m.graph.copy(sealedNodes = m.graph.vertecies.filter { v =>
        sealedRelations.contains(v.dri)
      }.toSet))
    }

  private def getSealedRelations(c: Member): Set[DRI] =
    val selfMapping = if c.modifiers.contains(Modifier.Sealed) then Set(c.dri) else Set.empty
    selfMapping ++ c.members.flatMap(getSealedRelations)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy