aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJon Skeet <skeet@pobox.com>2015-09-30 09:58:07 +0100
committerJon Skeet <skeet@pobox.com>2015-09-30 09:58:07 +0100
commitaa7ea3b698ed0ca4ae7e9bf2b1996db00063de32 (patch)
treef0283ea0d6ad799dcf1e66e96774c4f6298905e0 /src
parent5ebac49f1ed26b9c71bab6b47c92542be367f278 (diff)
parent6bbbdfa24c51c9aae1c58f25c84ad9759f05eab9 (diff)
downloadprotobuf-aa7ea3b698ed0ca4ae7e9bf2b1996db00063de32.tar.gz
protobuf-aa7ea3b698ed0ca4ae7e9bf2b1996db00063de32.tar.bz2
protobuf-aa7ea3b698ed0ca4ae7e9bf2b1996db00063de32.zip
Merge pull request #834 from jskeet/docfixes
Add (some) XML documentation to generated code
Diffstat (limited to 'src')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_message.cc8
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc6
2 files changed, 11 insertions, 3 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc
index a71a7909..16f7b0af 100644
--- a/src/google/protobuf/compiler/csharp/csharp_message.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_message.cc
@@ -169,6 +169,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
printer->Print(
vars,
"private object $name$_;\n"
+ "/// <summary>Enum of possible cases for the \"$original_name$\" oneof.</summary>\n"
"public enum $property_name$OneofCase {\n");
printer->Indent();
printer->Print("None = 0,\n");
@@ -199,8 +200,11 @@ void MessageGenerator::Generate(io::Printer* printer) {
// Nested messages and enums
if (HasNestedGeneratedTypes()) {
- printer->Print("#region Nested types\n"
- "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n");
+ printer->Print(
+ vars,
+ "#region Nested types\n"
+ "/// <summary>Container for nested types declared in the $class_name$ message type.</summary>\n"
+ "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n");
WriteGeneratedCodeAttributes(printer);
printer->Print("public static partial class Types {\n");
printer->Indent();
diff --git a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc
index 4b347708..7cf101b0 100644
--- a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc
@@ -135,7 +135,9 @@ void UmbrellaClassGenerator::WriteIntroduction(io::Printer* printer) {
}
printer->Print(
- "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n");
+ "/// <summary>Holder for reflection information generated from $file_name$</summary>\n"
+ "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n",
+ "file_name", file_->name());
WriteGeneratedCodeAttributes(printer);
printer->Print(
"$access_level$ static partial class $umbrella_class_name$ {\n"
@@ -148,12 +150,14 @@ void UmbrellaClassGenerator::WriteIntroduction(io::Printer* printer) {
void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) {
printer->Print(
"#region Descriptor\n"
+ "/// <summary>File descriptor for $file_name$</summary>\n"
"public static pbr::FileDescriptor Descriptor {\n"
" get { return descriptor; }\n"
"}\n"
"private static pbr::FileDescriptor descriptor;\n"
"\n"
"static $umbrella_class_name$() {\n",
+ "file_name", file_->name(),
"umbrella_class_name", umbrellaClassname_);
printer->Indent();
printer->Print(