More simple implementation

This commit is contained in:
Valentin Kipyatkov
2015-05-28 22:52:30 +03:00
parent 494d96bbc7
commit c1e0469188
@@ -110,13 +110,7 @@ inline public fun PsiElement.getChildrenOfType<reified T: PsiElement>(): Array<T
}
public fun PsiElement.getNextSiblingIgnoringWhitespaceAndComments(): PsiElement? {
var current = this
do {
current = current.getNextSibling()
if (current == null) return null
}
while (current is PsiComment || current is PsiWhiteSpace)
return current
return siblings(withItself = false).filter { it !is PsiWhiteSpace && it !is PsiComment }.firstOrNull()
}
public fun PsiElement?.isAncestor(element: PsiElement, strict: Boolean = false): Boolean {