Hello,I want to match a leading_comments value with the related protobuf entity it is written next to.Let suppose that I got the following protobuf:syntax = "proto3";
enum Greeting {
NONE = 0;
MR = 1;
MRS = 2;
MISS = 3;
}
// Documentation for the message
message Hello {
// Documentation for the greeting field
Greeting greeting = 1;
// Documentation for the name
string name = 2;
}
I'm using protoc and writing a short plugin that looks like this: https://gist.github.com/remyleone/54725a5be6d152a406929036512981e4
It generates a request.txt that I print:
What I don't know is how to match the comments with the related protobuf entity. I'm not sure about how to use location with its span and path. Is there any helper to do the matching? Or a tutorial?
Do you know how to do this? Could I do with go?
Best regards
Rémy