github.com/hoveychen/protoreflect@v1.4.7-0.20221103114119-0b4b3385ec76/desc/protoprint/testfiles/desc_test_comments-compact.proto (about) 1 // This is the first detached comment for the syntax. 2 // This is a second detached comment. 3 // This is a third. 4 // Syntax comment... 5 syntax = "proto2"; // Syntax trailer. 6 // And now the package declaration 7 package foo.bar; 8 // option comments FTW!!! 9 option go_package = "github.com/hoveychen/protoreflect/internal/testprotos"; 10 import "google/protobuf/empty.proto"; 11 import "desc_test_options.proto"; 12 // Multiple white space lines (like above) cannot 13 // be preserved... 14 // We need a request for our RPC service below. 15 message Request { 16 option deprecated = true; // deprecated! 17 // A field comment 18 repeated int32 ids = 1 [packed = true, json_name = "|foo|", (testprotos.ffubar) = "abc", (testprotos.ffubarb) = "xyz"]; // field trailer #1... 19 // lead mfubar 20 option (testprotos.mfubar) = true; // trailing mfubar 21 // some detached comments 22 // some detached comments 23 // Another field comment 24 // label comment 25 optional string name = 2 [default = "fubar"]; 26 extensions 100 to 200; 27 extensions 201 to 250 [(testprotos.exfubarb) = "\000\001\002\003\004\005\006\007", (testprotos.exfubar) = "splat!"]; 28 reserved 10 to 20, 30 to 50; 29 reserved "foo", "bar", "baz"; 30 // Group comment 31 optional group Extras = 3 { 32 // this is a custom option 33 option (testprotos.mfubar) = false; 34 optional double dbl = 1; 35 optional float flt = 2; 36 option no_standard_descriptor_accessor = false; 37 // Leading comment... 38 optional string str = 3; // Trailing comment... 39 } 40 enum MarioCharacters { 41 // allow_alias comments! 42 option allow_alias = true; 43 MARIO = 1 [(testprotos.evfubars) = -314, (testprotos.evfubar) = 278]; 44 LUIGI = 2 [(testprotos.evfubaruf) = 100, (testprotos.evfubaru) = 200]; 45 PEACH = 3; 46 BOWSER = 4; 47 option (testprotos.efubars) = -321; 48 WARIO = 5; 49 WALUIGI = 6; 50 SHY_GUY = 7 [(testprotos.evfubarsf) = 10101]; 51 HEY_HO = 7; 52 MAGIKOOPA = 8; 53 KAMEK = 8; 54 SNIFIT = -101; 55 option (testprotos.efubar) = 123; 56 } 57 // can be this or that 58 oneof abc { 59 string this = 4; 60 int32 that = 5; 61 } 62 // can be these or those 63 oneof xyz { 64 string these = 6; 65 int32 those = 7; 66 } 67 // map field 68 map<string, string> things = 8; 69 } 70 extend Request { 71 // comment for guid1 72 optional uint64 guid1 = 123; 73 // ... and a comment for guid2 74 optional uint64 guid2 = 124; 75 } 76 message AnEmptyMessage { 77 } 78 // Service comment 79 service RpcService { 80 // option that sets field 81 option (testprotos.sfubar) = { id:100 name:"bob" }; 82 option deprecated = false; // DEPRECATED! 83 option (testprotos.sfubare) = VALUE; 84 // Method comment 85 rpc StreamingRpc ( stream Request ) returns ( Request ); 86 rpc UnaryRpc ( Request ) returns ( google.protobuf.Empty ) { 87 option deprecated = true; 88 option (testprotos.mtfubar) = 12.340000; 89 option (testprotos.mtfubard) = 123.456000; 90 } 91 }