@@ -11,8 +11,10 @@ import org.jetbrains.dokka.model.properties.ExtraProperty
1111// import java.util.Stream // TODO reproduction uncomment
1212import java .util .stream .Stream // comment out - wrong error!
1313import java .util .stream .Collectors
14+ import java .util .Collections
1415import org .jetbrains .dokka .plugability ._
1516import kotlin .jvm .JvmClassMappingKt .getKotlinClass
17+ import org .jetbrains .dokka .links ._
1618
1719val U : kotlin.Unit = kotlin.Unit .INSTANCE
1820
@@ -26,15 +28,43 @@ type JMap[K, V] = java.util.Map[K, V]
2628type JHashMap [K , V ] = java.util.HashMap [K , V ]
2729type JMapEntry [K , V ] = java.util.Map .Entry [K , V ]
2830
29- private val emptyListInst = JList ()
31+ private val emptyListInst = Collections .emptyList
3032def JNil [A ] = emptyListInst.asInstanceOf [JList [A ]]
3133
32- private val emptyMapInst = JMap ()
34+ private val emptyMapInst = Collections .emptyMap
3335def emptyJMap [A , B ] = emptyMapInst.asInstanceOf [JMap [A , B ]]
3436
3537type DRI = org.jetbrains.dokka.links.DRI
3638val topLevelDri = org.jetbrains.dokka.links.DRI .Companion .getTopLevel
3739
40+ extension (dri : DRI )
41+ def withNoOrigin = dri._copy(
42+ extra = Option (dri.getExtra).fold(null )(e => raw " \[origin:(.*)\] " .r.replaceAllIn(e, " " ))
43+ )
44+
45+ def location : String = dri.getPackageName
46+
47+ def anchor : Option [String ] = Option (dri.getClassNames).filterNot(_.isEmpty)
48+
49+ def extra : String = dri.getExtra
50+
51+ def target : DriTarget = dri.getTarget
52+
53+ def _copy (
54+ location : String = dri.location,
55+ anchor : Option [String ] = dri.anchor,
56+ target : DriTarget = dri.target,
57+ extra : String = dri.extra
58+ ) = new DRI (location, anchor.getOrElse(" " ), null , target, extra)
59+
60+ object DRI :
61+ def apply (
62+ location : String = " " ,
63+ anchor : Option [String ] = None ,
64+ target : DriTarget = PointingToDeclaration .INSTANCE ,
65+ extra : String = " "
66+ ) = new DRI (location, anchor.getOrElse(" " ), null , target, extra)
67+
3868type SourceSetWrapper = DokkaConfiguration $DokkaSourceSet
3969type DokkaSourceSet = DokkaConfiguration .DokkaSourceSet
4070
0 commit comments