From 4bff8edaafc862a8d05105c62c8ad0fe92bc04ff Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Thu, 24 Jul 2025 17:30:00 +0200 Subject: [PATCH] Fix generation is run for imported files --- .../kotlin/kotlinx/rpc/protobuf/ProtoToModelInterpreter.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/ProtoToModelInterpreter.kt b/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/ProtoToModelInterpreter.kt index bf5c9d843..c317e77a3 100644 --- a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/ProtoToModelInterpreter.kt +++ b/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/ProtoToModelInterpreter.kt @@ -25,7 +25,9 @@ class ProtoToModelInterpreter( private val rootResolver = NameResolver.create(logger) fun interpretProtocRequest(message: CodeGeneratorRequest): Model { - return Model(message.protoFileList.map { it.toModel() }) + val protoFileMap = message.protoFileList.associateBy { it.name } + + return Model(message.fileToGenerateList.map { protoFileMap.getValue(it).toModel() }) } // package name of a currently parsed file