[uast] removing some useless stuff

This commit is contained in:
Nicolay Mitropolsky
2019-03-04 14:32:28 +03:00
parent 8677fa9ece
commit 132fbab53c
@@ -95,7 +95,8 @@ fun UElement?.getUCallExpression(searchLimit: Int = Int.MAX_VALUE): UCallExpress
}
}?.firstOrNull()
@Deprecated(message = "This function is deprecated, use getContainingUFile", replaceWith = ReplaceWith("getContainingUFile()"))
@Deprecated(message = "This function is deprecated, use getContainingUFile, will be removed in IDEA 2019.2",
replaceWith = ReplaceWith("getContainingUFile()"))
fun UElement.getContainingFile(): UFile? = getContainingUFile()
fun UElement.getContainingUFile(): UFile? = getParentOfType(UFile::class.java)
@@ -110,9 +111,6 @@ fun UElement.getContainingMethod(): PsiMethod? = getContainingUMethod()?.psi
@Deprecated(message = "Useless function, will be removed in IDEA 2019.1", replaceWith = ReplaceWith("getContainingUClass()?.javaPsi"))
fun UElement.getContainingClass(): PsiClass? = getContainingUClass()?.psi
@Deprecated(message = "Useless function, will be removed in IDEA 2019.1", replaceWith = ReplaceWith("getContainingUVariable()?.javaPsi"))
fun UElement.getContainingVariable(): PsiVariable? = getContainingUVariable()?.psi
@Deprecated(message = "Useless function, will be removed in IDEA 2019.1",
replaceWith = ReplaceWith("PsiTreeUtil.getParentOfType(this, PsiClass::class.java)"))
fun PsiElement?.getContainingClass(): PsiClass? = this?.let { PsiTreeUtil.getParentOfType(it, PsiClass::class.java) }
@@ -139,7 +137,8 @@ fun UElement.isUastChildOf(probablyParent: UElement?, strict: Boolean = false):
return isChildOf(if (strict) uastParent else this, probablyParent)
}
@Deprecated("contains a bug in negation of `strict` parameter", replaceWith = ReplaceWith("isUastChildOf(probablyElement, strict)"))
@Deprecated("contains a bug in negation of `strict` parameter, will be removed in IDEA 2019.2",
replaceWith = ReplaceWith("isUastChildOf(probablyElement, strict)"))
fun UElement.isChildOf(probablyParent: UElement?, strict: Boolean = false) = isUastChildOf(probablyParent, !strict)
/**