Skip to content

Commit 0119c01

Browse files
committed
remove bad suffix in parameter description that confuses doxygen
1 parent e4fdbcc commit 0119c01

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

generator/internal/descriptor_utils.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ ParameterCommentSubstitution substitutions[] = {
322322
{"\n", "\n /// "},
323323
};
324324

325+
char const* bad_suffixes[] = {
326+
// Doxygen interprets this as an unpaired formatting character.
327+
"\n ."};
328+
325329
// Very long parameters need different formatting.
326330
auto constexpr kShortParamFormat = " /// @param %s %s\n";
327331
auto constexpr kLongParamFormat = R"""( /// @param %s %s
@@ -349,6 +353,9 @@ std::string FormattedCommentsForParameter(
349353
if (std::count(comment.begin(), comment.end(), '\n') > kTooManyLines) {
350354
std::vector<absl::string_view> paragraphs = absl::StrSplit(comment, "\n\n");
351355
auto brief = std::string{paragraphs.front()};
356+
for (auto const& suffix : bad_suffixes) {
357+
brief = std::string{absl::StripSuffix(brief, suffix)};
358+
}
352359
for (auto& sub : substitutions) {
353360
sub.uses += absl::StrReplaceAll({{sub.before, sub.after}}, &brief);
354361
}
@@ -357,6 +364,9 @@ std::string FormattedCommentsForParameter(
357364
method.input_type()->full_name());
358365
}
359366

367+
for (auto const& suffix : bad_suffixes) {
368+
comment = std::string{absl::StripSuffix(comment, suffix)};
369+
}
360370
for (auto& sub : substitutions) {
361371
sub.uses += absl::StrReplaceAll({{sub.before, sub.after}}, &comment);
362372
}

google/cloud/oracledatabase/v1/oracle_database_client.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,6 @@ class OracleDatabaseClient {
10091009
///
10101010
/// @param parent Required. The parent value for database node in the following format:
10111011
/// projects/{project}/locations/{location}/cloudVmClusters/{cloudVmCluster}.
1012-
/// .
10131012
/// @param opts Optional. Override the class-level options, such as retry and
10141013
/// backoff policies.
10151014
/// @return a [StreamRange](@ref google::cloud::StreamRange)

0 commit comments

Comments
 (0)