瀏覽代碼

Move the summary comments above the attributes.
(Generated code changes coming next...)

Jon Skeet 10 年之前
父節點
當前提交
1351d20c31

+ 6 - 6
src/google/protobuf/compiler/csharp/csharp_message.cc

@@ -200,13 +200,13 @@ void MessageGenerator::Generate(io::Printer* printer) {
 
   // Nested messages and enums
   if (HasNestedGeneratedTypes()) {
-    printer->Print("#region Nested types\n"
-		   "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n");
-    WriteGeneratedCodeAttributes(printer);
     printer->Print(
-        vars,
-        "/// <summary>Container for nested types declared in the $class_name$ message type.</summary>\n"
-        "public static partial class Types {\n");
+      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();
     for (int i = 0; i < descriptor_->enum_type_count(); i++) {
       EnumGenerator enumGenerator(descriptor_->enum_type(i));

+ 3 - 3
src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc

@@ -135,13 +135,13 @@ 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(
-    "/// <summary>Holder for reflection information generated from $file_name$</summary>\n"
     "$access_level$ static partial class $umbrella_class_name$ {\n"
     "\n",
-    "file_name", file_->name(),
     "access_level", class_access_level(),
     "umbrella_class_name", umbrellaClassname_);
   printer->Indent();