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

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

The 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