diff --git a/backend/codegen/src/main/kotlin/net/mamoe/mirai/console/codegen/_Setting.value.kt codegen.kt b/backend/codegen/src/main/kotlin/net/mamoe/mirai/console/codegen/_Setting.value.kt codegen.kt index 096cc1fe3..21398fb9a 100644 --- a/backend/codegen/src/main/kotlin/net/mamoe/mirai/console/codegen/_Setting.value.kt codegen.kt +++ b/backend/codegen/src/main/kotlin/net/mamoe/mirai/console/codegen/_Setting.value.kt codegen.kt @@ -17,10 +17,13 @@ object _Setting_value_ktCodegen { override val defaultInvokeArgs: List = KtPrimitives + KtString override fun StringBuilder.apply(ktType: KtType) { - appendKCode( - """ + appendLine( + kCode( + """ + @JvmStatic val ${ktType.standardName}SerializerDescriptor = ${ktType.standardName}.serializer().descriptor """ + ).lines().joinToString("\n") { " $it" } ) } } diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/setting/internal/_Setting.value.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/setting/internal/_Setting.value.kt index 0f0d9a5b1..f0daa4bf7 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/setting/internal/_Setting.value.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/setting/internal/_Setting.value.kt @@ -16,19 +16,37 @@ import net.mamoe.mirai.console.setting.Setting internal object BuiltInSerializerConstants { - //// region BuiltInSerializerConstants primitives CODEGEN //// +//// region BuiltInSerializerConstants primitives CODEGEN //// + @JvmStatic val ByteSerializerDescriptor = Byte.serializer().descriptor + + @JvmStatic val ShortSerializerDescriptor = Short.serializer().descriptor + + @JvmStatic val IntSerializerDescriptor = Int.serializer().descriptor + + @JvmStatic val LongSerializerDescriptor = Long.serializer().descriptor + + @JvmStatic val FloatSerializerDescriptor = Float.serializer().descriptor + + @JvmStatic val DoubleSerializerDescriptor = Double.serializer().descriptor + + @JvmStatic val CharSerializerDescriptor = Char.serializer().descriptor + + @JvmStatic val BooleanSerializerDescriptor = Boolean.serializer().descriptor + + @JvmStatic val StringSerializerDescriptor = String.serializer().descriptor - //// endregion BuiltInSerializerConstants primitives CODEGEN //// + +//// endregion BuiltInSerializerConstants primitives CODEGEN //// } //// region Setting.value primitives impl CODEGEN ////