diff options
Diffstat (limited to 'core/src/main/kotlin/model')
-rw-r--r-- | core/src/main/kotlin/model/Documentable.kt | 11 | ||||
-rw-r--r-- | core/src/main/kotlin/model/WithChildren.kt | 2 | ||||
-rw-r--r-- | core/src/main/kotlin/model/documentableProperties.kt | 9 |
3 files changed, 20 insertions, 2 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index c7b2290e..64c3e14c 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -518,6 +518,15 @@ fun <T> SourceSetDependent<T>?.orEmpty(): SourceSetDependent<T> = this ?: emptyM interface DocumentableSource { val path: String + + /** + * Computes the first line number of the documentable's declaration/signature/identifier. + * + * Numbering is always 1-based. + * + * May return null if the sources could not be found - for example, for synthetic/generated declarations. + */ + fun computeLineNumber(): Int? } -data class TypeConstructorWithKind(val typeConstructor: TypeConstructor, val kind: ClassKind)
\ No newline at end of file +data class TypeConstructorWithKind(val typeConstructor: TypeConstructor, val kind: ClassKind) diff --git a/core/src/main/kotlin/model/WithChildren.kt b/core/src/main/kotlin/model/WithChildren.kt index 01a188c8..7412971a 100644 --- a/core/src/main/kotlin/model/WithChildren.kt +++ b/core/src/main/kotlin/model/WithChildren.kt @@ -91,4 +91,4 @@ fun <T : WithChildren<T>> T.asPrintableTree( } return buildString { append(this@asPrintableTree, "", "") } -}
\ No newline at end of file +} diff --git a/core/src/main/kotlin/model/documentableProperties.kt b/core/src/main/kotlin/model/documentableProperties.kt index 9fe8aa1d..4e743b0a 100644 --- a/core/src/main/kotlin/model/documentableProperties.kt +++ b/core/src/main/kotlin/model/documentableProperties.kt @@ -49,6 +49,15 @@ object IsVar : ExtraProperty<DProperty>, ExtraProperty.Key<DProperty, IsVar> { override val key: ExtraProperty.Key<DProperty, *> = this } +data class IsAlsoParameter(val inSourceSets: List<DokkaSourceSet>) : ExtraProperty<DProperty> { + companion object : ExtraProperty.Key<DProperty, IsAlsoParameter> { + override fun mergeStrategyFor(left: IsAlsoParameter, right: IsAlsoParameter): MergeStrategy<DProperty> = + MergeStrategy.Replace(IsAlsoParameter(left.inSourceSets + right.inSourceSets)) + } + + override val key: ExtraProperty.Key<DProperty, *> = IsAlsoParameter +} + data class CheckedExceptions(val exceptions: SourceSetDependent<List<DRI>>) : ExtraProperty<Documentable>, ExtraProperty.Key<Documentable, ObviousMember> { companion object : ExtraProperty.Key<Documentable, CheckedExceptions> { override fun mergeStrategyFor(left: CheckedExceptions, right: CheckedExceptions) = |