[SLC] reduce number of lazyPub calls
^KT-54051
This commit is contained in:
committed by
Space Team
parent
608d1e3431
commit
812e0413c2
+1
-1
@@ -45,7 +45,7 @@ private class SymbolNameValuePairForAnnotationArgument(
|
||||
|
||||
override fun setValue(p0: PsiAnnotationMemberValue) = cannotModify()
|
||||
|
||||
private val _nameIdentifier: PsiIdentifier by lazyPub {
|
||||
private val _nameIdentifier: PsiIdentifier by lazy {
|
||||
LightIdentifier(parent.manager, constantValue.name.asString())
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -11,7 +11,6 @@ import com.intellij.psi.PsiAnnotationParameterList
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.impl.PsiImplUtil
|
||||
import org.jetbrains.kotlin.analysis.api.annotations.KtAnnotationApplication
|
||||
import org.jetbrains.kotlin.asJava.classes.lazyPub
|
||||
import org.jetbrains.kotlin.light.classes.symbol.basicIsEquivalentTo
|
||||
import org.jetbrains.kotlin.psi.KtCallElement
|
||||
|
||||
@@ -26,8 +25,8 @@ internal class SymbolLightAnnotationForAnnotationCall(
|
||||
override fun findDeclaredAttributeValue(attributeName: String?) =
|
||||
PsiImplUtil.findDeclaredAttributeValue(this, attributeName)
|
||||
|
||||
private val _parameterList: PsiAnnotationParameterList by lazyPub {
|
||||
SymbolAnnotationParameterList(this@SymbolLightAnnotationForAnnotationCall, annotationCall.arguments)
|
||||
private val _parameterList: PsiAnnotationParameterList by lazy {
|
||||
SymbolAnnotationParameterList(this, annotationCall.arguments)
|
||||
}
|
||||
|
||||
override fun getParameterList(): PsiAnnotationParameterList = _parameterList
|
||||
|
||||
+2
-3
@@ -10,7 +10,6 @@ import com.intellij.psi.PsiAnnotationParameterList
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.impl.PsiImplUtil
|
||||
import org.jetbrains.kotlin.analysis.api.annotations.KtNamedAnnotationValue
|
||||
import org.jetbrains.kotlin.asJava.classes.lazyPub
|
||||
import org.jetbrains.kotlin.psi.KtCallElement
|
||||
|
||||
internal class SymbolLightSimpleAnnotation(
|
||||
@@ -36,8 +35,8 @@ internal class SymbolLightSimpleAnnotation(
|
||||
override fun findDeclaredAttributeValue(attributeName: String?) =
|
||||
PsiImplUtil.findDeclaredAttributeValue(this, attributeName)
|
||||
|
||||
private val _parameterList: PsiAnnotationParameterList by lazyPub {
|
||||
SymbolAnnotationParameterList(this@SymbolLightSimpleAnnotation, arguments)
|
||||
private val _parameterList: PsiAnnotationParameterList by lazy {
|
||||
SymbolAnnotationParameterList(this, arguments)
|
||||
}
|
||||
|
||||
override fun getParameterList(): PsiAnnotationParameterList = _parameterList
|
||||
|
||||
+3
-3
@@ -66,7 +66,7 @@ abstract class SymbolLightClassForClassOrObject(protected val classOrObject: KtC
|
||||
internal val isAnnotation: Boolean get() = classOrObject is KtClass && classOrObject.isAnnotation()
|
||||
internal val isEnum: Boolean get() = classOrObject is KtClass && classOrObject.isEnum()
|
||||
|
||||
private val _isDeprecated: Boolean by lazyPub {
|
||||
private val _isDeprecated: Boolean by lazy {
|
||||
withClassOrObjectSymbol { it.hasDeprecatedAnnotation() }
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ abstract class SymbolLightClassForClassOrObject(protected val classOrObject: KtC
|
||||
abstract override fun getOwnFields(): List<KtLightField>
|
||||
abstract override fun getOwnMethods(): List<PsiMethod>
|
||||
|
||||
private val _identifier: PsiIdentifier by lazyPub {
|
||||
private val _identifier: PsiIdentifier by lazy {
|
||||
KtLightIdentifier(this, classOrObject)
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ abstract class SymbolLightClassForClassOrObject(protected val classOrObject: KtC
|
||||
abstract override fun getExtendsList(): PsiReferenceList?
|
||||
abstract override fun getImplementsList(): PsiReferenceList?
|
||||
|
||||
private val _typeParameterList: PsiTypeParameterList? by lazyPub {
|
||||
private val _typeParameterList: PsiTypeParameterList? by lazy {
|
||||
hasTypeParameters().ifTrue {
|
||||
SymbolLightTypeParameterList(
|
||||
owner = this,
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ class SymbolLightClassForFacade(
|
||||
}
|
||||
}
|
||||
|
||||
private val multiFileClass: Boolean by lazyPub {
|
||||
private val multiFileClass: Boolean by lazy {
|
||||
files.size > 1 || firstFileInFacade.isJvmMultifileClassFile
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -14,7 +14,6 @@ import com.intellij.util.PlatformIcons
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import org.jetbrains.kotlin.asJava.builder.LightMemberOrigin
|
||||
import org.jetbrains.kotlin.asJava.classes.cannotModify
|
||||
import org.jetbrains.kotlin.asJava.classes.lazyPub
|
||||
import org.jetbrains.kotlin.asJava.elements.KtLightField
|
||||
import org.jetbrains.kotlin.asJava.elements.KtLightIdentifier
|
||||
import org.jetbrains.kotlin.idea.KotlinLanguage
|
||||
@@ -37,7 +36,7 @@ internal abstract class SymbolLightField protected constructor(
|
||||
|
||||
override fun hasInitializer(): Boolean = initializer !== null
|
||||
|
||||
private val _identifier: PsiIdentifier by lazyPub {
|
||||
private val _identifier: PsiIdentifier by lazy {
|
||||
KtLightIdentifier(this, kotlinOrigin)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ internal class SymbolLightFieldForEnumEntry(
|
||||
|
||||
private val hasBody: Boolean get() = enumEntry.body != null
|
||||
|
||||
private val _initializingClass: PsiEnumConstantInitializer? by lazyPub {
|
||||
private val _initializingClass: PsiEnumConstantInitializer? by lazy {
|
||||
hasBody.ifTrue {
|
||||
SymbolLightClassForEnumEntry(
|
||||
enumConstant = this@SymbolLightFieldForEnumEntry,
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ internal class SymbolLightFieldForObject(
|
||||
}
|
||||
}
|
||||
|
||||
val lazyAnnotations = lazyPub {
|
||||
val lazyAnnotations = lazy {
|
||||
val notNullAnnotation = SymbolLightSimpleAnnotation(NotNull::class.java.name, this)
|
||||
listOf(notNullAnnotation)
|
||||
}
|
||||
@@ -53,7 +53,7 @@ internal class SymbolLightFieldForObject(
|
||||
SymbolLightMemberModifierList(this, lazyModifiers, lazyAnnotations)
|
||||
}
|
||||
|
||||
private val _isDeprecated: Boolean by lazyPub {
|
||||
private val _isDeprecated: Boolean by lazy {
|
||||
withObjectDeclarationSymbol { objectSymbol ->
|
||||
objectSymbol.hasDeprecatedAnnotation()
|
||||
}
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ internal class SymbolLightFieldForProperty private constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private val _isDeprecated: Boolean by lazyPub {
|
||||
private val _isDeprecated: Boolean by lazy {
|
||||
withPropertySymbol { propertySymbol ->
|
||||
propertySymbol.hasDeprecatedAnnotation(AnnotationUseSiteTarget.FIELD)
|
||||
}
|
||||
|
||||
+3
-3
@@ -103,7 +103,7 @@ internal class SymbolLightAccessorMethod private constructor(
|
||||
|
||||
override fun getName(): String = _name
|
||||
|
||||
private val _typeParameterList: PsiTypeParameterList? by lazyPub {
|
||||
private val _typeParameterList: PsiTypeParameterList? by lazy {
|
||||
hasTypeParameters().ifTrue {
|
||||
SymbolLightTypeParameterList(
|
||||
owner = this,
|
||||
@@ -193,7 +193,7 @@ internal class SymbolLightAccessorMethod private constructor(
|
||||
|
||||
override fun isConstructor(): Boolean = false
|
||||
|
||||
private val _isDeprecated: Boolean by lazyPub {
|
||||
private val _isDeprecated: Boolean by lazy {
|
||||
analyzeForLightClasses(ktModule) {
|
||||
propertySymbol().hasDeprecatedAnnotation(accessorSite)
|
||||
}
|
||||
@@ -201,7 +201,7 @@ internal class SymbolLightAccessorMethod private constructor(
|
||||
|
||||
override fun isDeprecated(): Boolean = _isDeprecated
|
||||
|
||||
private val _identifier: PsiIdentifier by lazyPub {
|
||||
private val _identifier: PsiIdentifier by lazy {
|
||||
KtLightIdentifier(this, containingPropertyDeclaration)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ internal abstract class SymbolLightMethod<FType : KtFunctionLikeSymbol> private
|
||||
KtLightIdentifier(this@SymbolLightMethod, functionDeclaration)
|
||||
}
|
||||
|
||||
private val _isDeprecated: Boolean by lazyPub {
|
||||
private val _isDeprecated: Boolean by lazy {
|
||||
withFunctionSymbol { functionSymbol ->
|
||||
functionSymbol.hasDeprecatedAnnotation()
|
||||
}
|
||||
|
||||
+3
-4
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.light.classes.symbol.methods
|
||||
|
||||
import com.intellij.psi.*
|
||||
import org.jetbrains.kotlin.asJava.builder.LightMemberOrigin
|
||||
import org.jetbrains.kotlin.asJava.classes.lazyPub
|
||||
import org.jetbrains.kotlin.asJava.elements.KtLightIdentifier
|
||||
import org.jetbrains.kotlin.light.classes.symbol.classes.SymbolLightClassForClassOrObject
|
||||
import org.jetbrains.kotlin.light.classes.symbol.modifierLists.SymbolLightMemberModifierList
|
||||
@@ -27,7 +26,7 @@ internal class SymbolLightNoArgConstructor(
|
||||
override fun getTypeParameterList(): PsiTypeParameterList? = null
|
||||
override fun getTypeParameters(): Array<PsiTypeParameter> = PsiTypeParameter.EMPTY_ARRAY
|
||||
|
||||
private val _identifier: PsiIdentifier by lazyPub {
|
||||
private val _identifier: PsiIdentifier by lazy {
|
||||
KtLightIdentifier(this, ktDeclaration = null)
|
||||
}
|
||||
|
||||
@@ -41,8 +40,8 @@ internal class SymbolLightNoArgConstructor(
|
||||
|
||||
override fun getModifierList(): PsiModifierList = _modifierList
|
||||
|
||||
private val _parameterList: PsiParameterList by lazyPub {
|
||||
SymbolLightParameterList(parent = this@SymbolLightNoArgConstructor)
|
||||
private val _parameterList: PsiParameterList by lazy {
|
||||
SymbolLightParameterList(parent = this)
|
||||
}
|
||||
|
||||
override fun getParameterList(): PsiParameterList = _parameterList
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ internal class SymbolLightParameterForReceiver private constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private val _name: String by lazyPub {
|
||||
private val _name: String by lazy {
|
||||
AsmUtil.getLabeledThisName(methodName, AsmUtil.LABELED_THIS_PARAMETER, AsmUtil.RECEIVER_PARAMETER_NAME)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ internal class SymbolLightSuspendContinuationParameter(
|
||||
override fun getModifierList(): PsiModifierList = _modifierList
|
||||
|
||||
private val _modifierList: PsiModifierList by lazy {
|
||||
val lazyAnnotations = lazyPub {
|
||||
val lazyAnnotations = lazy {
|
||||
if (withFunctionSymbol { it.visibility.isPrivateOrPrivateToThis() })
|
||||
emptyList()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user