nscn.polaris2.protoc.bridge.codegen

Members list

Type members

Classlikes

Base class for a protoc code generator.

Base class for a protoc code generator.

Implementors provide process and, if their .proto options are custom extensions, registerExtensions - without the registry the options arrive as unknown fields and silently read back as defaults.

The same object works as a standalone protoc-gen-* executable (via main) and as an in-JVM generator driven by the bridge (via run).

Attributes

Supertypes
class Object
trait Matchable
class Any
final case class CodeGenRequest(parameter: String, filesToGenerate: Seq[FileDescriptor], allProtos: Seq[FileDescriptor], compilerVersion: Option[Version], asProto: CodeGeneratorRequest)

A CodeGeneratorRequest with its file protos already linked into FileDescriptors.

A CodeGeneratorRequest with its file protos already linked into FileDescriptors.

Linking matters for editions: FileDescriptor.buildFrom is what runs protobuf-java's feature resolution, so only after this do hasPresence, isPacked, isClosed and friends report edition-aware answers. Reading FileDescriptorProto directly would force every generator to reimplement that resolution.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait CodeGenResponse

Either the files a generator produced, or the reason it could not.

Either the files a generator produced, or the reason it could not.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
object Editions

The descriptor queries a generator needs for editions, including stand-ins for the three protobuf-java methods that are package-private.

The descriptor queries a generator needs for editions, including stand-ins for the three protobuf-java methods that are package-private.

A generator should ask these questions through feature-resolved predicates - hasPresence, isPacked, isClosed - and not by testing the syntax. What is left here is the handful of cases where protobuf-java's public API has a gap.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Editions.type