kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/cxx/indexer/proto/testdata/basic/doc.proto (about)

     1  // Test proto for doc comments.
     2  
     3  syntax = "proto2";
     4  
     5  package proto_kythe_test;
     6  
     7  //- @+10"DocComment" defines/binding DocCommentMessage
     8  //- DocCommentComment.node/kind doc
     9  //- DocCommentComment documents DocCommentMessage
    10  //- DocCommentComment.text
    11  //-   "A doc comment is a piece of text which documents a code element.\nDoc comments can have html code in them.\n\n"
    12  
    13  // A doc comment is a piece of text which documents a code element.
    14  // Doc comments can have html code in them.
    15  //
    16  //
    17  message DocComment {
    18  
    19    //- Type1Comment.node/kind doc
    20    //- Type1Comment.text
    21    //-   "This field determines the type of a comment.\nA comment can be single line or multi-line."
    22    //- Type1Comment documents Type1Message
    23    //- @+2"type1" defines/binding Type1Message
    24  
    25    optional CommentType type1 = 2;
    26    // This field determines the type of a comment.
    27    // A comment can be single line or multi-line.
    28  
    29    //- @+3"content1" defines/binding _Content1Field
    30  
    31    // Comment content includes comment marks.
    32    optional string content1 = 3;
    33    // comment marks are: //, /*, *, and */
    34  
    35    //- HtmlTreeComment.node/kind doc
    36    //- HtmlTreeComment.text "The html part\nof the comment"
    37    //- HtmlTreeComment documents HtmlTreeMessage
    38    //- @+4"HtmlTree" defines/binding HtmlTreeMessage
    39  
    40    /* The html part
    41     * of the comment */
    42    message HtmlTree {
    43  
    44      //- @+3"content2" defines/binding _Content2Field
    45  
    46      // content of the html
    47      optional string content2 = 1;
    48  
    49      //- TagTypeComment.node/kind doc
    50      //- TagTypeComment.text "\nType of a tag\n"
    51      //- TagTypeComment documents TagTypeEnum
    52      //- @+5"TagType" defines/binding TagTypeEnum
    53  
    54      /*
    55       * Type of a tag
    56       */
    57      enum TagType {
    58  
    59        //- ClosedValueDoc.node/kind doc
    60        //- ClosedValueDoc.text "Closed"
    61        //- ClosedValueDoc documents ClosedValue
    62        //- @+2"CLOSED" defines/binding ClosedValue
    63  
    64        CLOSED = 0; // Closed
    65  
    66        //- OpenValueDoc.node/kind doc
    67        //- OpenValueDoc.text "Open"
    68        //- OpenValueDoc documents OpenValue
    69        //- @+2"OPEN" defines/binding OpenValue
    70  
    71        OPEN = 1; /* Open */
    72      }
    73  
    74      //- @+3"type2" defines/binding _Type2Field
    75  
    76      /* The type of the tag */
    77      optional TagType type2 = 2;
    78  
    79      //- CromulentComment.node/kind doc
    80      //- CromulentComment documents CromulentField
    81      //- @+11"cromulent" defines/binding CromulentField
    82  
    83      /*
    84       *
    85       * Some other field, I guess?
    86       *
    87       * I don't know.
    88       *
    89       * I just write these comments.
    90       *
    91       */
    92      optional bool cromulent = 3;
    93    }
    94  }
    95  
    96  //- CommentTypeEnumComment.node/kind doc
    97  //- CommentTypeEnumComment.text "Structural type of a comment"
    98  //- CommentTypeEnumComment documents CommentTypeEnum
    99  //- @+2"CommentType" defines/binding CommentTypeEnum
   100  
   101  enum CommentType {
   102    // Structural type of a comment
   103  
   104    //- SingleLineComment.node/kind doc
   105    //- SingleLineComment.text "Only one line comment"
   106    //- SingleLineComment documents SingleLineValue
   107    //- @+2"SINGLE_LINE" defines/binding SingleLineValue
   108  
   109    SINGLE_LINE = 8;
   110    /* Only one line comment */
   111  
   112    //- MultiLineComment.node/kind doc
   113    //- MultiLineComment.text "Comment which spans to multiple lines.\nHere is another line"
   114    //- MultiLineComment documents MultiLineValue
   115    //- @+2"MULTI_LINE" defines/binding MultiLineValue
   116  
   117    MULTI_LINE = 2;
   118    /* Comment which spans to multiple lines.
   119     * Here is another line */
   120  
   121    //- WeirdComment.node/kind doc
   122    //- WeirdComment documents WeirdValue
   123    //- @+2"WEIRD_MULTI_LINE" defines/binding WeirdValue
   124  
   125    WEIRD_MULTI_LINE = 4; /*
   126                           *
   127                           * Who is doing this.
   128                           *
   129                           * Who thought comments should look like this.
   130                           *
   131                           */
   132  }
   133  
   134  //- DocServiceComment.node/kind doc
   135  //- DocServiceComment.text "Doc service comment\nmore of the DocService comment, for some reason."
   136  //- DocServiceComment documents DocServiceNode
   137  //- @+2"DocService" defines/binding DocServiceNode
   138  
   139  service DocService { /* Doc service comment
   140  * more of the DocService comment, for some reason. */
   141  
   142    //- GetDocCommentComment.node/kind doc
   143    //- GetDocCommentComment.text "GetDocComment comment"
   144    //- GetDocCommentComment documents GetMethod
   145    //- @+2"GetDocComment" defines/binding GetMethod
   146  
   147    rpc GetDocComment(DocComment) returns (DocComment) {
   148      // GetDocComment comment
   149    }
   150  }