More simple implementation
This commit is contained in:
@@ -110,13 +110,7 @@ inline public fun PsiElement.getChildrenOfType<reified T: PsiElement>(): Array<T
|
|||||||
}
|
}
|
||||||
|
|
||||||
public fun PsiElement.getNextSiblingIgnoringWhitespaceAndComments(): PsiElement? {
|
public fun PsiElement.getNextSiblingIgnoringWhitespaceAndComments(): PsiElement? {
|
||||||
var current = this
|
return siblings(withItself = false).filter { it !is PsiWhiteSpace && it !is PsiComment }.firstOrNull()
|
||||||
do {
|
|
||||||
current = current.getNextSibling()
|
|
||||||
if (current == null) return null
|
|
||||||
}
|
|
||||||
while (current is PsiComment || current is PsiWhiteSpace)
|
|
||||||
return current
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun PsiElement?.isAncestor(element: PsiElement, strict: Boolean = false): Boolean {
|
public fun PsiElement?.isAncestor(element: PsiElement, strict: Boolean = false): Boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user