fix(proto): include deprecation tags for messages, enums and enum values. (#3822)

diff --git a/kythe/cxx/indexer/proto/file_descriptor_walker.cc b/kythe/cxx/indexer/proto/file_descriptor_walker.cc
index 7dfad61..8590669 100644
--- a/kythe/cxx/indexer/proto/file_descriptor_walker.cc
+++ b/kythe/cxx/indexer/proto/file_descriptor_walker.cc
@@ -482,6 +482,9 @@
       InitializeLocation(span, &location);
 
       builder_->AddEnumType(message, v_name, location);
+      if (nested_proto->options().deprecated()) {
+        builder_->SetDeprecated(v_name);
+      }
       AttachMarkedSource(v_name,
                          GenerateMarkedSourceForDescriptor(nested_proto));
     }
@@ -524,6 +527,9 @@
       InitializeLocation(span, &location);
 
       builder_->AddMessageType(message, v_name, location);
+      if (nested_proto->options().deprecated()) {
+        builder_->SetDeprecated(v_name);
+      }
       AttachMarkedSource(v_name,
                          GenerateMarkedSourceForDescriptor(nested_proto));
     }
@@ -593,6 +599,9 @@
 
       builder_->AddMessageType(ns, v_name, location);
       AttachMarkedSource(v_name, GenerateMarkedSourceForDescriptor(dp));
+      if (dp->options().deprecated()) {
+        builder_->SetDeprecated(v_name);
+      }
     }
 
     // Visit nested types first and fields later for easy type resolution
@@ -650,6 +659,9 @@
     std::string value_vname = dp->full_name() + "." + val_dp->name();
 
     builder_->AddValueToEnum(*enum_node, v_name, value_location);
+    if (val_dp->options().deprecated()) {
+      builder_->SetDeprecated(v_name);
+    }
     AttachMarkedSource(v_name, GenerateMarkedSourceForDescriptor(val_dp));
   }
 }
diff --git a/kythe/cxx/indexer/proto/testdata/basic/deprecated.proto b/kythe/cxx/indexer/proto/testdata/basic/deprecated.proto
index 2673e8e..1501b1c 100644
--- a/kythe/cxx/indexer/proto/testdata/basic/deprecated.proto
+++ b/kythe/cxx/indexer/proto/testdata/basic/deprecated.proto
@@ -3,7 +3,13 @@
 package proto_kythe_test;
 option java_package = "io.kythe";
 
+//- @M defines/binding Message
+//- Message.node/kind record
+//- Message.tag/deprecated ""
 message M {
+
+  option deprecated = true;
+
   //- @field1 defines/binding F1
   //- F1.tag/deprecated ""
   optional string field1 = 1 [deprecated=true];
@@ -14,4 +20,51 @@
 
   // Fields that are annotated with [deprecated=true] should be tagged as
   // deprecated by the proto indexer.
+
+  //- @N1 defines/binding Nested1
+  //- Nested1.node/kind record
+  //- Nested1.tag/deprecated ""
+  message N1 {
+    option deprecated = true;
+
+    //- @field3 defines/binding F3
+    //- F3.tag/deprecated ""
+    optional string field3 = 1 [deprecated = true];
+  }
+
+  //- @N2 defines/binding Nested2
+  //- Nested2.node/kind record
+  //- !{ Nested2.tag/deprecated "" }
+  message N2 {
+
+    //- @field4 defines/binding F4
+    //- F4.tag/deprecated ""
+    optional string field4 = 1 [deprecated = true];
+  }
+
+
+  //- @D defines/binding EnumD
+  //- EnumD.node/kind sum
+  //- EnumD.tag/deprecated ""
+  enum D {
+    option deprecated = true;
+    //- @VAL1 defines/binding Value1Node
+    //- ! { Value1Node.tag/deprecated "" }
+    VAL1 = 1;
+    //- @VAL2 defines/binding Value2Node
+    //- Value2Node.tag/deprecated ""
+    VAL2 = 2 [ deprecated = true ];
+  }
+
+  //- @E defines/binding EnumE
+  //- EnumE.node/kind sum
+  //- ! { EnumE.tag/deprecated "" }
+  enum E {
+    //- @VAL3 defines/binding Value3Node
+    //- ! { Value3Node.tag/deprecated "" }
+    VAL3 = 3;
+    //- @VAL4 defines/binding Value4Node
+    //- Value4Node.tag/deprecated ""
+    VAL4 = 4 [ deprecated = true ];
+  }
 }