[SLC] replace SymbolAnnotationParameterList with SymbolLazyAnnotationParameterList

^KT-56046
This commit is contained in:
Dmitrii Gridin
2023-01-23 14:13:56 +01:00
committed by Space Team
parent 73707941bb
commit 871bfab6da
4 changed files with 3 additions and 34 deletions
@@ -1,31 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.light.classes.symbol.annotations
import com.intellij.psi.PsiAnnotationParameterList
import com.intellij.psi.PsiNameValuePair
import org.jetbrains.kotlin.analysis.api.annotations.KtNamedAnnotationValue
import org.jetbrains.kotlin.asJava.classes.lazyPub
import org.jetbrains.kotlin.asJava.elements.KtLightElementBase
import org.jetbrains.kotlin.psi.KtElement
internal class SymbolAnnotationParameterList(
parent: SymbolLightAbstractAnnotation,
private val arguments: List<KtNamedAnnotationValue>,
) : KtLightElementBase(parent), PsiAnnotationParameterList {
private val _attributes: Array<PsiNameValuePair> by lazyPub {
arguments.map {
SymbolNameValuePairForAnnotationArgument(it, this)
}.toTypedArray()
}
override fun getAttributes(): Array<PsiNameValuePair> = _attributes
override val kotlinOrigin: KtElement? get() = null
//TODO: EQ GHC EQIV
}
@@ -13,7 +13,7 @@ import org.jetbrains.kotlin.asJava.elements.KtLightElementBase
import org.jetbrains.kotlin.psi.KtElement
internal class SymbolLazyAnnotationParameterList(
parent: SymbolLightLazyAnnotation,
parent: SymbolLightAbstractAnnotation,
private val lazyArguments: Lazy<List<KtNamedAnnotationValue>>,
) : KtLightElementBase(parent),
PsiAnnotationParameterList {
@@ -24,7 +24,7 @@ internal class SymbolLightAnnotationForAnnotationCall(
PsiImplUtil.findDeclaredAttributeValue(this, attributeName)
private val _parameterList: PsiAnnotationParameterList by lazyPub {
SymbolAnnotationParameterList(this, annotationCall.arguments)
SymbolLazyAnnotationParameterList(this, lazyOf(annotationCall.arguments))
}
override fun getParameterList(): PsiAnnotationParameterList = _parameterList
@@ -37,7 +37,7 @@ internal class SymbolLightSimpleAnnotation(
PsiImplUtil.findDeclaredAttributeValue(this, attributeName)
private val _parameterList: PsiAnnotationParameterList by lazyPub {
SymbolAnnotationParameterList(this, arguments)
SymbolLazyAnnotationParameterList(this, lazyOf(arguments))
}
override fun getParameterList(): PsiAnnotationParameterList = _parameterList