FIR IDE: add info about varargs to parmater symbol

This commit is contained in:
Ilya Kirillov
2020-06-29 15:30:57 +03:00
parent f10f6c6360
commit 75a96f0153
3 changed files with 7 additions and 5 deletions
@@ -20,7 +20,7 @@ abstract class KtFunctionSymbol : KtFunctionLikeSymbol(), KtNamedSymbol, KtPossi
abstract val isOperator: Boolean abstract val isOperator: Boolean
abstract val fqName: FqName? abstract val fqName: FqName?
abstract override val valueParameters: List<KtSimpleFunctionParameterSymbol> abstract override val valueParameters: List<KtFunctionParameterSymbol>
} }
abstract class KtConstructorSymbol : KtFunctionLikeSymbol() { abstract class KtConstructorSymbol : KtFunctionLikeSymbol() {
@@ -30,7 +30,9 @@ abstract class KtPropertySymbol : KtVariableSymbol(), KtPossibleExtensionSymbol
abstract class KtLocalVariableSymbol : KtVariableSymbol() abstract class KtLocalVariableSymbol : KtVariableSymbol()
abstract class KtSimpleFunctionParameterSymbol : KtParameterSymbol() abstract class KtFunctionParameterSymbol : KtParameterSymbol() {
abstract val isVararg: Boolean
}
abstract class KtConstructorParameterSymbol : KtParameterSymbol(), KtNamedSymbol { abstract class KtConstructorParameterSymbol : KtParameterSymbol(), KtNamedSymbol {
abstract val constructorParameterKind: KtConstructorParameterSymbolKind abstract val constructorParameterKind: KtConstructorParameterSymbolKind
@@ -13,7 +13,7 @@ import org.jetbrains.kotlin.idea.frontend.api.KtType
import org.jetbrains.kotlin.idea.frontend.api.fir.KtSymbolByFirBuilder import org.jetbrains.kotlin.idea.frontend.api.fir.KtSymbolByFirBuilder
import org.jetbrains.kotlin.idea.frontend.api.fir.utils.cached import org.jetbrains.kotlin.idea.frontend.api.fir.utils.cached
import org.jetbrains.kotlin.idea.frontend.api.fir.utils.weakRef import org.jetbrains.kotlin.idea.frontend.api.fir.utils.weakRef
import org.jetbrains.kotlin.idea.frontend.api.symbols.KtSimpleFunctionParameterSymbol import org.jetbrains.kotlin.idea.frontend.api.symbols.KtFunctionParameterSymbol
import org.jetbrains.kotlin.idea.frontend.api.symbols.KtSymbolKind import org.jetbrains.kotlin.idea.frontend.api.symbols.KtSymbolKind
import org.jetbrains.kotlin.idea.frontend.api.withValidityAssertion import org.jetbrains.kotlin.idea.frontend.api.withValidityAssertion
import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.Name
@@ -22,12 +22,12 @@ internal class KtFirFunctionValueParameterSymbol(
fir: FirValueParameterImpl, fir: FirValueParameterImpl,
override val token: ValidityOwner, override val token: ValidityOwner,
private val builder: KtSymbolByFirBuilder private val builder: KtSymbolByFirBuilder
) : KtSimpleFunctionParameterSymbol(), ) : KtFunctionParameterSymbol(), KtFirSymbol<FirValueParameterImpl> {
KtFirSymbol<FirValueParameterImpl> {
override val fir: FirValueParameterImpl by weakRef(fir) override val fir: FirValueParameterImpl by weakRef(fir)
override val psi: PsiElement? by cached { fir.findPsi(fir.session) } override val psi: PsiElement? by cached { fir.findPsi(fir.session) }
override val name: Name get() = withValidityAssertion { fir.name } override val name: Name get() = withValidityAssertion { fir.name }
override val isVararg: Boolean get() = withValidityAssertion { fir.isVararg }
override val type: KtType by cached { builder.buildKtType(fir.returnTypeRef) } override val type: KtType by cached { builder.buildKtType(fir.returnTypeRef) }
override val symbolKind: KtSymbolKind get() = KtSymbolKind.LOCAL override val symbolKind: KtSymbolKind get() = KtSymbolKind.LOCAL
} }