@@ -29,11 +29,15 @@ import org.jetbrains.kotlin.fir.types.toSymbol
29
29
import org.jetbrains.kotlin.fir.types.toTypeProjection
30
30
import org.jetbrains.kotlin.name.CallableId
31
31
import org.jetbrains.kotlin.name.FqName
32
- import org.jetbrains.kotlin.name.Name
33
32
import org.jetbrains.kotlin.types.Variance
34
33
import org.jetbrains.kotlinx.dataframe.annotations.DataSchema
34
+ import org.jetbrains.kotlinx.dataframe.plugin.extensions.impl.PropertyName
35
35
36
- class ExtensionsGenerator (session : FirSession ) : FirDeclarationGenerationExtension(session) {
36
+ /* *
37
+ * extensions inside scope classes are generated here:
38
+ * @see org.jetbrains.kotlinx.dataframe.plugin.extensions.TokenGenerator
39
+ */
40
+ class TopLevelExtensionsGenerator (session : FirSession ) : FirDeclarationGenerationExtension(session) {
37
41
private companion object {
38
42
val dataSchema = FqName (DataSchema ::class .qualifiedName!! )
39
43
}
@@ -83,7 +87,7 @@ class ExtensionsGenerator(session: FirSession) : FirDeclarationGenerationExtensi
83
87
val columnName = property.getAnnotationByClassId(Names .COLUMN_NAME_ANNOTATION , session)?.let { annotation ->
84
88
(annotation.argumentMapping.mapping[Names .COLUMN_NAME_ARGUMENT ] as ? FirLiteralExpression )?.value as ? String?
85
89
}
86
- val propertyName = property.name
90
+ val name = property.name
87
91
val marker = owner.constructType(arrayOf(), isNullable = false ).toTypeProjection(Variance .INVARIANT )
88
92
89
93
val columnGroupProjection: ConeTypeProjection ? = if (resolvedReturnTypeRef.coneType.classId?.equals(
@@ -115,8 +119,7 @@ class ExtensionsGenerator(session: FirSession) : FirDeclarationGenerationExtensi
115
119
typeArguments = arrayOf(marker),
116
120
isNullable = false
117
121
),
118
- propertyName = propertyName,
119
- columnName = columnName,
122
+ propertyName = PropertyName .of(name, columnName?.let { PropertyName .buildAnnotation(it) }),
120
123
returnTypeRef = resolvedReturnTypeRef
121
124
)
122
125
@@ -138,8 +141,7 @@ class ExtensionsGenerator(session: FirSession) : FirDeclarationGenerationExtensi
138
141
typeArguments = arrayOf(marker),
139
142
isNullable = false
140
143
),
141
- propertyName = propertyName,
142
- columnName = columnName,
144
+ propertyName = PropertyName .of(name, columnName?.let { PropertyName .buildAnnotation(it) }),
143
145
returnTypeRef = columnReturnType
144
146
)
145
147
listOf (rowExtension.symbol, columnsContainerExtension.symbol)
0 commit comments