aboutsummaryrefslogtreecommitdiff
path: root/src/Analysis/CommentsAPI.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Analysis/CommentsAPI.kt')
-rw-r--r--src/Analysis/CommentsAPI.kt5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Analysis/CommentsAPI.kt b/src/Analysis/CommentsAPI.kt
index 2407de76..215f3e98 100644
--- a/src/Analysis/CommentsAPI.kt
+++ b/src/Analysis/CommentsAPI.kt
@@ -10,9 +10,8 @@ fun DeclarationDescriptor.getDocumentationElements(): List<KDoc> {
if (psiElement == null)
return listOf()
- return psiElement.previousSiblings() // go backwards
- .takeWhile { it !is JetDeclaration } // till previous declaration
- .filter { it is KDoc } // get KDocs
+ return psiElement.children() // visit children
+ .takeWhile { it is KDoc } // all KDoc
.map { it as KDoc } // cast
.toList()
.reverse() // make reversed list