getFirstChild().siblings -> allChildren
This commit is contained in:
@@ -21,9 +21,10 @@ import org.jetbrains.kotlin.kdoc.psi.api.KDoc
|
|||||||
import org.jetbrains.kotlin.psi.psiUtil.siblings
|
import org.jetbrains.kotlin.psi.psiUtil.siblings
|
||||||
import com.intellij.psi.PsiWhiteSpace
|
import com.intellij.psi.PsiWhiteSpace
|
||||||
import com.intellij.psi.PsiComment
|
import com.intellij.psi.PsiComment
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.allChildren
|
||||||
|
|
||||||
fun findDocComment(declaration: JetDeclaration): KDoc? {
|
fun findDocComment(declaration: JetDeclaration): KDoc? {
|
||||||
return declaration.getFirstChild().siblings()
|
return declaration.allChildren
|
||||||
.dropWhile { it !is KDoc && (it is PsiWhiteSpace || it is PsiComment) }
|
.dropWhile { it !is KDoc && (it is PsiWhiteSpace || it is PsiComment) }
|
||||||
.first() as? KDoc
|
.first() as? KDoc
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ data class DataForConversion private(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun tryClipLeftSide(element: PsiElement, leftBound: Int)
|
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? {
|
private fun tryClipRightSide(element: PsiElement, rightBound: Int): Int? {
|
||||||
fun Int.transform() = Int.MAX_VALUE - this
|
fun Int.transform() = Int.MAX_VALUE - this
|
||||||
|
|||||||
Reference in New Issue
Block a user