nscn.polaris2.mill.generator

Members list

Type members

Classlikes

object Http4sGrpcCodeGenerator extends CodeGenApp

Emits http4s service bindings for every service in a .proto.

Emits http4s service bindings for every service in a .proto.

Ported from org.http4s.grpc.generator.Http4sGrpcCodeGenerator, and rebased from ScalaPB onto mill-protoc: the message types it refers to are the ones nscn.polaris2.protoc.codegen.Scala3Generator emits, and the naming decisions come from the same GenContext that generator uses. Sharing that context is what keeps flat_package, (nscn.polaris2.protoc.file).package_name and the rest agreeing across the two targets; a service referring to a type name the message generator did not produce is the failure mode this avoids.

mill-protoc's own generator ignores service declarations entirely, so the two targets never write the same file.

This is a plain ProtocCodeGenerator, so it runs in-process through the bridge (how nscn.polaris2.mill.Http4sGrpcModule drives it) or as a standalone protoc plugin through its inherited main.

Attributes

Supertypes
trait CodeGenApp
trait ProtocCodeGenerator
class Object
trait Matchable
class Any
Self type
class Http4sGrpcServicePrinter(service: ServiceDescriptor, ctx: GenContext)

Ported from org.http4s.grpc.generator.Http4sGrpcServicePrinter (http4s-grpc), with ScalaPB's DescriptorImplicits replaced by mill-protoc's GenContext.

Ported from org.http4s.grpc.generator.Http4sGrpcServicePrinter (http4s-grpc), with ScalaPB's DescriptorImplicits replaced by mill-protoc's GenContext.

Message type names come from messageType, which resolves them the same way mill-protoc's own printers do - ctx.fullName for a generated message, WellKnownTypeMappings for one of protobuf's - so the two targets cannot disagree about where a message landed or what it was mapped to. Those names are already _root_.-qualified; prefixRoot exists for the names this printer builds itself out of a package and a simple name, and is idempotent so that qualifying twice is not a way to emit _root_._root_.foo.Bar - the upstream bug this port was forked to fix.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type