File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ class ModelToKotlinCommonGenerator(
439439
440440 private fun FieldDeclaration.wireSizeCall (variable : String ): String {
441441 val sizeFunc =
442- " $PB_PKG .WireSize.${type.decodeEncodeFuncName()!! .replaceFirstChar { it.lowercase() } } ($variable )"
442+ " $PB_PKG .WireSize.${type.decodeEncodeFuncName()!! .decapitalize() } ($variable )"
443443 return when (val fieldType = type) {
444444 is FieldType .IntegralType -> when {
445445 fieldType.wireType == WireType .FIXED32 -> " 32"
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ private fun Descriptors.Descriptor.toModel(): MessageDeclaration = cached {
125125 regularFields = regularFields + oneOfs.map {
126126 FieldDeclaration (
127127 // TODO: Proper handling of this field name
128- it.name.simpleName.lowercase (),
128+ it.name.simpleName.decapitalize (),
129129 FieldType .OneOf (it),
130130 doc = null ,
131131 dec = it.variants.first().dec,
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+ */
4+
5+ package kotlinx.rpc.protobuf
6+
7+ internal fun String.decapitalize (): String {
8+ return this .replaceFirstChar { it.lowercase() }
9+ }
You can’t perform that action at this time.
0 commit comments