[psi] don't load ast for compiled code

deserialized parameters do not contain real default values anyway
This commit is contained in:
Anna Kozlova
2023-04-17 09:57:27 +02:00
committed by teamcity
parent 1f4e4f94a7
commit 6ba4e37696
@@ -85,7 +85,16 @@ public class KtParameter extends KtNamedDeclarationStub<KotlinParameterStub> imp
@Nullable
public KtExpression getDefaultValue() {
KotlinParameterStub stub = getStub();
if (stub != null && !stub.hasDefaultValue()) return null;
if (stub != null) {
if (!stub.hasDefaultValue()) {
return null;
}
if (getContainingKtFile().isCompiled()) {
//don't load ast
return null;
}
}
PsiElement equalsToken = getEqualsToken();
return equalsToken != null ? PsiTreeUtil.getNextSiblingOfType(equalsToken, KtExpression.class) : null;