aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/model/WithChildren.kt
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2020-07-17 03:48:03 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-11 14:27:44 +0200
commitaeb2014eee704be377c06205d16f60562d2a8cf1 (patch)
treed144b627a0b379bebedf7e015f6d469fea61d0bb /core/src/main/kotlin/model/WithChildren.kt
parent49c9bcc586abb7c78f569526a05fea97da86993d (diff)
downloaddokka-aeb2014eee704be377c06205d16f60562d2a8cf1.tar.gz
dokka-aeb2014eee704be377c06205d16f60562d2a8cf1.tar.bz2
dokka-aeb2014eee704be377c06205d16f60562d2a8cf1.zip
Fixing javadoc comment parser for psi files
Diffstat (limited to 'core/src/main/kotlin/model/WithChildren.kt')
-rw-r--r--core/src/main/kotlin/model/WithChildren.kt3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/main/kotlin/model/WithChildren.kt b/core/src/main/kotlin/model/WithChildren.kt
index 589bcd2a..06ff55b0 100644
--- a/core/src/main/kotlin/model/WithChildren.kt
+++ b/core/src/main/kotlin/model/WithChildren.kt
@@ -13,6 +13,9 @@ inline fun <reified T> WithChildren<*>.firstChildOfTypeOrNull(predicate: (T) ->
inline fun <reified T> WithChildren<*>.firstChildOfType(): T =
children.filterIsInstance<T>().first()
+inline fun <reified T> WithChildren<*>.childrenOfType(): List<T> =
+ children.filterIsInstance<T>()
+
inline fun <reified T> WithChildren<*>.firstChildOfType(predicate: (T) -> Boolean): T =
children.filterIsInstance<T>().first(predicate)