getFirstChild().siblings -> allChildren

This commit is contained in:
Valentin Kipyatkov
2015-05-28 22:03:18 +03:00
parent bf09906f35
commit c8223fff9e
2 changed files with 3 additions and 2 deletions
@@ -21,9 +21,10 @@ import org.jetbrains.kotlin.kdoc.psi.api.KDoc
import org.jetbrains.kotlin.psi.psiUtil.siblings
import com.intellij.psi.PsiWhiteSpace
import com.intellij.psi.PsiComment
import org.jetbrains.kotlin.psi.psiUtil.allChildren
fun findDocComment(declaration: JetDeclaration): KDoc? {
return declaration.getFirstChild().siblings()
return declaration.allChildren
.dropWhile { it !is KDoc && (it is PsiWhiteSpace || it is PsiComment) }
.first() as? KDoc
}
@@ -168,7 +168,7 @@ data class DataForConversion private(
}
private fun tryClipLeftSide(element: PsiElement, leftBound: Int)
= tryClipSide(element, leftBound, { range }, { getFirstChild().siblings() })
= tryClipSide(element, leftBound, { range }, { allChildren })
private fun tryClipRightSide(element: PsiElement, rightBound: Int): Int? {
fun Int.transform() = Int.MAX_VALUE - this