Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: format proto comments in Client Overview #2280

Merged
merged 4 commits into from Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -242,7 +242,7 @@ private static String createTableOfMethods(List<MethodAndVariants> methodAndVari
.append(method.method)
.append("</td>\n")
.append(" <td>")
.append("<p>" + method.description + "</p>")
.append(CommentFormatter.formatAsJavaDocComment(method.description, null))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the whole table a String and format with CommentFormatter? This fix should be good for now, but in the future, someone else may add another line with dynamic content that could result in the same bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The challenge with formatting the whole table with CommentFormatter is that it replaces all of the html elements for the table with the HTML-escaped character sequence for them, so the output doesn't stay formatted as a table. You can see the example output here: cl/572240700

.append("</td>\n")
.append(" <td>\n");
generateUnorderedListMethodVariants(
Expand Down
Expand Up @@ -38,7 +38,7 @@ import javax.annotation.Generated;
* <th>Method Variants</th>
* <tr>
* <td>NestedMessageMethod</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand Down
Expand Up @@ -38,7 +38,7 @@ import javax.annotation.Generated;
* <th>Method Variants</th>
* <tr>
* <td>GetBook</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand Down
Expand Up @@ -37,7 +37,7 @@ import javax.annotation.Generated;
* <th>Method Variants</th>
* <tr>
* <td>FastFibonacci</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -51,7 +51,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>SlowFibonacci</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand Down
Expand Up @@ -59,7 +59,7 @@ import javax.annotation.Generated;
* <th>Method Variants</th>
* <tr>
* <td>Echo</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -84,7 +84,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>Expand</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
Expand All @@ -94,7 +94,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>Collect</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
Expand All @@ -104,7 +104,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>Chat</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
Expand All @@ -114,7 +114,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>ChatAgain</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
Expand All @@ -124,7 +124,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>PagedExpand</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -139,7 +139,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>SimplePagedExpand</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -158,7 +158,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>Wait</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -178,7 +178,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>Block</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -192,7 +192,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>CollideName</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand Down
Expand Up @@ -47,7 +47,7 @@ import javax.annotation.Generated;
* <th>Method Variants</th>
* <tr>
* <td>CreateUser</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -67,7 +67,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>GetUser</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -86,7 +86,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>UpdateUser</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -100,7 +100,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>DeleteUser</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -119,7 +119,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>ListUsers</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand Down
Expand Up @@ -54,7 +54,7 @@ import javax.annotation.Generated;
* <th>Method Variants</th>
* <tr>
* <td>CreateRoom</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -72,7 +72,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>GetRoom</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -91,7 +91,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>UpdateRoom</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -105,7 +105,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>DeleteRoom</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -124,7 +124,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>ListRooms</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -139,7 +139,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>CreateBlurb</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -162,7 +162,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>GetBlurb</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -181,7 +181,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>UpdateBlurb</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -195,7 +195,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>DeleteBlurb</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -214,7 +214,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>ListBlurbs</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -235,7 +235,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>SearchBlurbs</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -254,7 +254,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>StreamBlurbs</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
Expand All @@ -264,7 +264,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>SendBlurbs</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
Expand All @@ -274,7 +274,7 @@ import javax.annotation.Generated;
* </tr>
* <tr>
* <td>Connect</td>
* <td><p></p></td>
* <td><p> </td>
* <td>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
Expand Down