FileOptionsResolver

nscn.polaris2.protoc.codegen.FileOptionsResolver
See theFileOptionsResolver companion object
final class FileOptionsResolver(allFiles: Seq[FileDescriptor])

Resolves the effective ScalaFileOptions for a file, including package-scoped ones.

A file can declare options for its whole proto package (scope = PACKAGE), which then apply to every file in that package and its subpackages. That exists so a file that cannot import nscn/polaris2/protoc/options.proto - a third-party schema, say - can still be configured, and it means the options on a descriptor are not the whole story.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def optionsFor(file: FileDescriptor): ScalaFileOptions

The options in force for this file: inherited package-scoped ones, then its own.

The options in force for this file: inherited package-scoped ones, then its own.

Merging with protobuf's own mergeFrom rather than field by field: for a singular field it takes the later value only when that value is present, which is exactly "the file's own setting wins if it made one", and for a repeated field it concatenates, which is what accumulating imports and preambles should do.

Attributes