diff options
author | Jon Skeet <jonskeet@google.com> | 2015-10-01 10:36:58 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-10-01 10:36:58 +0100 |
commit | 67dd42c50d2b6d9c208bb1a4c63ee879781a9ac1 (patch) | |
tree | f306f386bc210138da58fa14568b4b930fe15a2b /src/google/protobuf/compiler/csharp/csharp_message.cc | |
parent | aa7ea3b698ed0ca4ae7e9bf2b1996db00063de32 (diff) |
First pass at generating XML documentation from .proto comments.
This could be tidied up significantly, and at some point we will want to parse the markdown and generate more appropriate XML - but this is definitely better than nothing.
Generated code changes coming in next commit.
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_message.cc')
-rw-r--r-- | src/google/protobuf/compiler/csharp/csharp_message.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc index 16f7b0af..21fbf7e3 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message.cc @@ -42,6 +42,7 @@ #include <google/protobuf/wire_format.h> #include <google/protobuf/wire_format_lite.h> +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> #include <google/protobuf/compiler/csharp/csharp_enum.h> #include <google/protobuf/compiler/csharp/csharp_field_base.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> @@ -101,6 +102,7 @@ void MessageGenerator::Generate(io::Printer* printer) { vars["class_name"] = class_name(); vars["access_level"] = class_access_level(); + WriteMessageDocComment(printer, descriptor_); printer->Print( "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n"); WriteGeneratedCodeAttributes(printer); @@ -152,7 +154,9 @@ void MessageGenerator::Generate(io::Printer* printer) { // Rats: we lose the debug comment here :( printer->Print( + "/// <summary>Field number for the \"$field_name$\" field.</summary>\n" "public const int $field_constant_name$ = $index$;\n", + "field_name", fieldDescriptor->name(), "field_constant_name", GetFieldConstantName(fieldDescriptor), "index", SimpleItoa(fieldDescriptor->number())); scoped_ptr<FieldGeneratorBase> generator( @@ -181,6 +185,7 @@ void MessageGenerator::Generate(io::Printer* printer) { } printer->Outdent(); printer->Print("}\n"); + // TODO: Should we put the oneof .proto comments here? It's unclear exactly where they should go. printer->Print( vars, "private $property_name$OneofCase $name$Case_ = $property_name$OneofCase.None;\n" |