File tree Expand file tree Collapse file tree 3 files changed +4
-8
lines changed
compiler-plugin/compiler-plugin-backend/src/main/kotlin/kotlinx/rpc/codegen/extension Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 44
55package kotlinx.rpc.codegen.extension
66
7+ import kotlinx.rpc.codegen.common.RpcClassId
78import kotlinx.rpc.codegen.common.RpcNames
89import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
910import org.jetbrains.kotlin.cli.common.messages.MessageCollector
@@ -17,7 +18,6 @@ import org.jetbrains.kotlin.ir.expressions.IrExpression
1718import org.jetbrains.kotlin.ir.util.dumpKotlinLike
1819import org.jetbrains.kotlin.ir.util.getAnnotation
1920import org.jetbrains.kotlin.ir.util.hasDefaultValue
20- import org.jetbrains.kotlin.ir.util.kotlinFqName
2121
2222/* *
2323 * This class scans user declared RPC service
@@ -30,7 +30,7 @@ internal object RpcDeclarationScanner {
3030 fun scanServiceDeclaration (service : IrClass , ctx : RpcIrContext , logger : MessageCollector ): ServiceDeclaration {
3131 var stubClass: IrClass ? = null
3232
33- val grpcAnnotation = service.getAnnotation(ctx .grpcAnnotation.owner.kotlinFqName )
33+ val grpcAnnotation = service.getAnnotation(RpcClassId .grpcAnnotation.asSingleFqName() )
3434 val protoPackage = grpcAnnotation?.arguments?.getOrNull(0 )?.asConstString() ? : " "
3535
3636 val declarations = service.declarations.memoryOptimizedMap { declaration ->
Original file line number Diff line number Diff line change @@ -64,10 +64,6 @@ internal class RpcIrContext(
6464 getRpcIrClassSymbol(" RpcServiceDescriptor" , " descriptor" )
6565 }
6666
67- val grpcAnnotation by lazy {
68- getIrClassSymbol(" kotlinx.rpc.grpc.annotations" , " Grpc" )
69- }
70-
7167 val grpcServiceDescriptor by lazy {
7268 getIrClassSymbol(" kotlinx.rpc.grpc.descriptor" , " GrpcServiceDescriptor" )
7369 }
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ private object Descriptor {
3636 const val CALLABLE_MAP = " callableMap"
3737 const val CALLABLES = " callables"
3838
39- // the kotlin class name (derived from java_package and name)
39+ // the kotlin class name
4040 const val FQ_NAME = " fqName"
4141 const val SIMPLE_NAME = " simpleName"
4242 const val GET_CALLABLE = " getCallable"
@@ -1085,7 +1085,7 @@ internal class RpcStubGenerator(
10851085 *
10861086 * ```kotlin
10871087 * serviceDescriptor(
1088- * name = MyService, // simpleName
1088+ * name = my.proto.package. MyService, // $declaration.serviceFqName
10891089 * methods = methodDescriptorMap.values, // Collection<MethodDescriptor<*, *>>
10901090 * schemaDescriptor = null, // for now, only null
10911091 * )
You can’t perform that action at this time.
0 commit comments