Include the field type in a comment for extension fields
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Fri, 26 Dec 2014 15:43:38 +0000 (17:43 +0200)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Fri, 26 Dec 2014 15:43:38 +0000 (17:43 +0200)
generator/nanopb_generator.py

index 19771a7..6dcc911 100755 (executable)
@@ -498,7 +498,8 @@ class ExtensionField(Field):
             msg +='   type of extension fields is currently supported. */\n'
             return msg
         
             msg +='   type of extension fields is currently supported. */\n'
             return msg
         
-        return 'extern const pb_extension_type_t %s;\n' % self.fullname
+        return ('extern const pb_extension_type_t %s; /* field type: %s */\n' %
+            (self.fullname, str(self).strip()))
 
     def extension_def(self):
         '''Definition of the extension type in the .pb.c file'''
 
     def extension_def(self):
         '''Definition of the extension type in the .pb.c file'''