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