github.com/bakjos/protoreflect@v1.9.2/desc/protoprint/testfiles/desc_test_comments-multiline-style-comments.proto (about)

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