AA: do not use full decompilation for built-ins

This is the major performance bottleneck for AA/UAST artifacts rollout
to Android Lint. KT stubs are good/fast enough.
This commit is contained in:
Jinseong Jeon
2023-01-17 00:43:22 -08:00
committed by Ilya Kirillov
parent 669afdd463
commit 2da4693cc0
4 changed files with 55 additions and 16 deletions
@@ -9,9 +9,24 @@ import com.intellij.psi.PsiElement
import com.intellij.psi.PsiMethod
import com.intellij.psi.PsiParameter
import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.psi.KtNamedFunction
import org.jetbrains.kotlin.psi.KtParameter
object TestPsiElementRenderer {
fun render(psiElement: PsiElement): String = when (psiElement) {
is KtNamedFunction -> buildString {
append("KtNamedFunction:")
append(psiElement.name)
append("(")
psiElement.valueParameters.joinTo(this) { render(it) }
append(")")
}
is KtParameter -> buildString {
if (psiElement.isVarArg) {
append("vararg ")
}
append(psiElement.name)
}
is KtElement -> psiElement.text
is PsiMethod -> buildString {
append("PsiMethod:")