[psi][AA] don't decompile code when stubs have enough information

^ KTIJ-25979
+ do not assert when there are no stubs (text is already computed)
This commit is contained in:
Anna Kozlova
2023-06-28 13:11:24 +02:00
committed by teamcity
parent 4ccea40651
commit 11c4fcda5f
2 changed files with 21 additions and 5 deletions
@@ -278,7 +278,7 @@ inline fun <reified T : PsiElement> PsiElement.findDescendantOfType(
fun PsiElement.checkDecompiledText() {
val file = containingFile
if (file is KtFile && file.isCompiled) {
if (file is KtFile && file.isCompiled && file.stub != null) {
error("Attempt to load decompiled text, please use stubs instead. Decompile process might be slow and should be avoided")
}
}