FIR IDE: add KtClassInitializerSymbol
This commit is contained in:
committed by
Ilya Kirillov
parent
6f9712a812
commit
50166c776c
+10
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright 2010-2021 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.analysis.api.symbols
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolWithKind
|
||||
|
||||
public abstract class KtClassInitializerSymbol : KtSymbol, KtSymbolWithKind
|
||||
+2
@@ -27,6 +27,7 @@ public abstract class KtSymbolProvider : KtAnalysisSessionComponent() {
|
||||
literalExpression?.let(::getAnonymousObjectSymbol) ?: getClassOrObjectSymbol(psi)
|
||||
}
|
||||
is KtPropertyAccessor -> getPropertyAccessorSymbol(psi)
|
||||
is KtClassInitializer -> getClassInitializerSymbol(psi)
|
||||
else -> error("Cannot build symbol for ${psi::class}")
|
||||
}
|
||||
|
||||
@@ -44,6 +45,7 @@ public abstract class KtSymbolProvider : KtAnalysisSessionComponent() {
|
||||
public abstract fun getClassOrObjectSymbol(psi: KtClassOrObject): KtClassOrObjectSymbol
|
||||
public abstract fun getNamedClassOrObjectSymbol(psi: KtClassOrObject): KtNamedClassOrObjectSymbol?
|
||||
public abstract fun getPropertyAccessorSymbol(psi: KtPropertyAccessor): KtPropertyAccessorSymbol
|
||||
public abstract fun getClassInitializerSymbol(psi: KtClassInitializer): KtClassInitializerSymbol
|
||||
|
||||
public abstract fun getClassOrObjectSymbolByClassId(classId: ClassId): KtClassOrObjectSymbol?
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
|
||||
class A {
|
||||
val i: Int
|
||||
init {
|
||||
i = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
KtFirKotlinPropertySymbol:
|
||||
annotatedType: [] kotlin/Int
|
||||
annotationClassIds: []
|
||||
annotations: []
|
||||
callableIdIfNonLocal: /A.i
|
||||
dispatchType: A
|
||||
getter: KtFirPropertyGetterSymbol(<getter>)
|
||||
hasBackingField: true
|
||||
hasGetter: true
|
||||
hasSetter: false
|
||||
initializer: null
|
||||
isConst: false
|
||||
isExtension: false
|
||||
isFromPrimaryConstructor: false
|
||||
isLateInit: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isVal: true
|
||||
modality: FINAL
|
||||
name: i
|
||||
origin: SOURCE
|
||||
receiverType: null
|
||||
setter: null
|
||||
symbolKind: MEMBER
|
||||
visibility: Public
|
||||
deprecationStatus: null
|
||||
getterDeprecationStatus: null
|
||||
javaGetterName: getI
|
||||
javaSetterName: null
|
||||
setterDeprecationStatus: null
|
||||
|
||||
KtFirClassInitializerSymbol:
|
||||
origin: SOURCE
|
||||
symbolKind: MEMBER
|
||||
deprecationStatus: null
|
||||
|
||||
KtFirNamedClassOrObjectSymbol:
|
||||
annotationClassIds: []
|
||||
annotations: []
|
||||
classIdIfNonLocal: A
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
isData: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: A
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
[] kotlin/Any
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
deprecationStatus: null
|
||||
Reference in New Issue
Block a user