KT-11974 Invert if-condition intention loses comments

#KT-11974 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-04-29 21:26:00 +03:00
parent 7b1bf4c7dd
commit 8da5af3a10
9 changed files with 59 additions and 9 deletions
@@ -163,6 +163,11 @@ tailrec fun PsiElement.getOutermostParentContainedIn(container: PsiElement): Psi
fun PsiElement.isInsideOf(elements: Iterable<PsiElement>): Boolean = elements.any { it.isAncestor(this) }
fun PsiChildRange.trimWhiteSpaces(): PsiChildRange {
if (first == null) return this
return PsiChildRange(first.siblings().firstOrNull { it !is PsiWhiteSpace }, last!!.siblings(forward = false).firstOrNull { it !is PsiWhiteSpace })
}
// -------------------- Recursive tree visiting --------------------------------------------------------------------------------------------
inline fun <reified T : PsiElement> PsiElement.forEachDescendantOfType(noinline action: (T) -> Unit) {