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(
439
439
440
440
private fun FieldDeclaration.wireSizeCall (variable : String ): String {
441
441
val sizeFunc =
442
- " $PB_PKG .WireSize.${type.decodeEncodeFuncName()!! .replaceFirstChar { it.lowercase() } } ($variable )"
442
+ " $PB_PKG .WireSize.${type.decodeEncodeFuncName()!! .decapitalize() } ($variable )"
443
443
return when (val fieldType = type) {
444
444
is FieldType .IntegralType -> when {
445
445
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 {
125
125
regularFields = regularFields + oneOfs.map {
126
126
FieldDeclaration (
127
127
// TODO: Proper handling of this field name
128
- it.name.simpleName.lowercase (),
128
+ it.name.simpleName.decapitalize (),
129
129
FieldType .OneOf (it),
130
130
doc = null ,
131
131
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