I'm parsing a large number of protobuf files and am using the Source Code 
Info descriptor to extract comment data from the source files as well. I 
currently use the FileDescriptorProto.ListFields() method to extract the 
DescriptorProto objects I care about as well as the SourceCodeInfo.

To my knowledge, the only way to pair up Location fields with the 
corresponding objects is via the path attribute 
<https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.descriptor.pb>.
 
This is fine; except for the fact that involves me manually stepping 
through said path to land at my parsed Protobuf Object. This gets 
complicated when dealing with layers of nested_types and I am convinced 
there must be a way for me to extract the path from the particular 
DescriptorProto Object and then use that to match up the object with the 
path specified in the corresponding Location field.

In short: How can I easily pair up DescriptorProto objects with the 
Location objects that correspond to them? Specifically for comment parsing 
purposes.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/e50e5c0f-d1eb-4d8e-b981-e37567f7f216n%40googlegroups.com.

Reply via email to