264
276
// early versions of proto2.
266
278
// Generic services are now considered deprecated in favor of using plugins
267
// that generate code specific to your particular RPC system. If you are
268
// using such a plugin, set these to false. In the future, we may change
269
// the default to false, so if you explicitly want generic services, you
270
// should explicitly set these to true.
271
optional bool cc_generic_services = 16 [default=true];
272
optional bool java_generic_services = 17 [default=true];
273
optional bool py_generic_services = 18 [default=true];
279
// that generate code specific to your particular RPC system. Therefore,
280
// these default to false. Old code which depends on generic services should
281
// explicitly set them to true.
282
optional bool cc_generic_services = 16 [default=false];
283
optional bool java_generic_services = 17 [default=false];
284
optional bool py_generic_services = 18 [default=false];
275
286
// The parser stores options it doesn't recognize here. See above.
276
287
repeated UninterpretedOption uninterpreted_option = 999;
430
441
optional int64 negative_int_value = 5;
431
442
optional double double_value = 6;
432
443
optional bytes string_value = 7;
444
optional string aggregate_value = 8;
447
// ===================================================================
448
// Optional source code info
450
// Encapsulates information about the original source file from which a
451
// FileDescriptorProto was generated.
452
message SourceCodeInfo {
453
// A Location identifies a piece of source code in a .proto file which
454
// corresponds to a particular definition. This information is intended
455
// to be useful to IDEs, code indexers, documentation generators, and similar
458
// For example, say we have a file like:
460
// optional string foo = 1;
462
// Let's look at just the field definition:
463
// optional string foo = 1;
466
// We have the following locations:
467
// span path represents
468
// [a,i) [ 4, 0, 2, 0 ] The whole field definition.
469
// [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
470
// [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
471
// [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
472
// [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
475
// - A location may refer to a repeated field itself (i.e. not to any
476
// particular index within it). This is used whenever a set of elements are
477
// logically enclosed in a single code segment. For example, an entire
478
// extend block (possibly containing multiple extension definitions) will
479
// have an outer location whose path refers to the "extensions" repeated
480
// field without an index.
481
// - Multiple locations may have the same path. This happens when a single
482
// logical declaration is spread out across multiple places. The most
483
// obvious example is the "extend" block again -- there may be multiple
484
// extend blocks in the same scope, each of which will have the same path.
485
// - A location's span is not always a subset of its parent's span. For
486
// example, the "extendee" of an extension declaration appears at the
487
// beginning of the "extend" block and is shared by all extensions within
489
// - Just because a location's span is a subset of some other location's span
490
// does not mean that it is a descendent. For example, a "group" defines
491
// both a type and a field in a single declaration. Thus, the locations
492
// corresponding to the type and field and their components will overlap.
493
// - Code which tries to interpret locations should probably be designed to
494
// ignore those that it doesn't understand, as more types of locations could
495
// be recorded in the future.
496
repeated Location location = 1;
498
// Identifies which part of the FileDescriptorProto was defined at this
501
// Each element is a field number or an index. They form a path from
502
// the root FileDescriptorProto to the place where the definition. For
503
// example, this path:
506
// file.message_type(3) // 4, 3
509
// This is because FileDescriptorProto.message_type has field number 4:
510
// repeated DescriptorProto message_type = 4;
511
// and DescriptorProto.field has field number 2:
512
// repeated FieldDescriptorProto field = 2;
513
// and FieldDescriptorProto.name has field number 1:
514
// optional string name = 1;
516
// Thus, the above path gives the location of a field name. If we removed
519
// this path refers to the whole field declaration (from the beginning
520
// of the label to the terminating semicolon).
521
repeated int32 path = 1 [packed=true];
523
// Always has exactly three or four elements: start line, start column,
524
// end line (optional, otherwise assumed same as start line), end column.
525
// These are packed into a single field for efficiency. Note that line
526
// and column numbers are zero-based -- typically you will want to add
527
// 1 to each before displaying to a user.
528
repeated int32 span = 2 [packed=true];
530
// TODO(kenton): Record comments appearing before and after the