Fix C# Compiler Parity and Descriptor Generation#30
Fix C# Compiler Parity and Descriptor Generation#30google-labs-jules[bot] wants to merge 1 commit into
Conversation
- Implement Reflection class generation in C# output including Base64 descriptor data. - Fix C# generator to output pragmas and regions. - Update Tokenizer and Parser to capture comments and populate SourceLocationTable. - Update Compiler to attach SourceCodeInfo to FileDescriptorProto. - Update CodeGenerator interface to allow passing FileDescriptorProto to generators. - Pass full FileDescriptorProto (with SourceCodeInfo) to CSharpCodeGenerator. - Update ComprehensiveCSharpProtoParityTest to verify SourceLocationTable population.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This change addresses failures in
ComprehensiveCSharpProtoParityTestby implementing missing features in the C# code generator and the underlying protobuf parser/compiler infrastructure.Key changes:
Reflectionclass, which contains the serializedFileDescriptorProtoas a Base64 string. ImplementedGeneratedClrTypeInfogeneration. Added correct#pragmaand#regionblocks to matchprotocoutput.Tokenizerto capture comments instead of discarding them. UpdatedParserto useLocationRecordercorrectly for nested elements (fields, nested messages, enums) and to attach captured comments to theSourceLocationTable.Compilerto attach the populatedSourceCodeInfo(fromSourceLocationTable) to theFileDescriptorProtobefore building theFileDescriptor.CodeGeneratorinterface to acceptFileDescriptorProtoingeneratemethod. This is crucial becauseFileDescriptor.toProto()inprotobuf-javatends to stripSourceCodeInfo, but the C# generator needs it to matchprotocoutput (which includes comments in the descriptor data).ComprehensiveCSharpProtoParityTestto correctly attachSourceCodeInfowhen parsing protos in-memory, mirroring the fix inCompiler.These changes ensure that the generated C# code structure matches the expected output from standard
protocand that the embedded descriptor data includes necessary metadata (like source locations/comments), bringing the compiler closer to full parity.PR created automatically by Jules for task 15615303074311053390 started by @voidifremoved