aboutsummaryrefslogtreecommitdiff
path: root/src/Analysis/PsiAPI.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 20:49:04 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 20:49:04 +0400
commit044308ba60a0d4462ccb7388f16ad17a31d7450d (patch)
treec93411f0670e29fe333962789c0df97b1602f7be /src/Analysis/PsiAPI.kt
parent8a4dad46b171c55dabc5f9be29e1261e1cc5928e (diff)
downloaddokka-044308ba60a0d4462ccb7388f16ad17a31d7450d.tar.gz
dokka-044308ba60a0d4462ccb7388f16ad17a31d7450d.tar.bz2
dokka-044308ba60a0d4462ccb7388f16ad17a31d7450d.zip
Complete package migration and move files into folders.
Diffstat (limited to 'src/Analysis/PsiAPI.kt')
-rw-r--r--src/Analysis/PsiAPI.kt19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Analysis/PsiAPI.kt b/src/Analysis/PsiAPI.kt
new file mode 100644
index 00000000..2282cd1d
--- /dev/null
+++ b/src/Analysis/PsiAPI.kt
@@ -0,0 +1,19 @@
+package org.jetbrains.dokka
+
+import com.intellij.psi.*
+import kotlin.support.*
+
+fun PsiElement.previousSiblings(): Stream<PsiElement> {
+ var element: PsiElement? = this
+ return object : Stream<PsiElement> {
+ override fun iterator(): Iterator<PsiElement> = object : AbstractIterator<PsiElement>() {
+ override fun computeNext() {
+ element = element?.getPrevSibling()
+ if (element == null)
+ done()
+ else
+ setNext(element!!)
+ }
+ }
+ }
+}