Merged
Conversation
Owner
pseudomuto
commented
Oct 21, 2025
- Add edition detection methods: GetEdition(), IsEditions(), GetEditionName()
- Add GetEditionComments() for accessing edition directive comments
- Add feature detection methods: HasExplicitFieldPresence(), GetSyntaxType()
- Enhance IsProto3() methods to maintain backward compatibility
- Add edition comment extraction in parser (field path 14)
- Create test fixtures for edition 2023 and 2024 syntax
- Add test coverage for editions parsing, services, enums, and messages
- Update descriptor set generation to include edition files
- Fix utils tests to account for additional proto files
- Reorganize types.go to follow code structure conventions
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive support for protobuf editions syntax (2023 and 2024) to the protokit library. The implementation maintains backward compatibility with existing proto2/proto3 detection while introducing new APIs for editions-specific features like explicit field presence and edition identification.
Key Changes:
- Introduces edition detection and feature methods (GetEdition, IsEditions, HasExplicitFieldPresence, GetSyntaxType)
- Adds EditionComments field for accessing edition directive comments
- Includes test fixtures for edition 2023 and 2024 with comprehensive test coverage
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| types.go | Adds edition-related methods and fields, reorganizes code structure by moving newCommon to end of file |
| parser.go | Adds edition comment extraction support via field path 14 |
| parser_test.go | Comprehensive test coverage for editions parsing, services, enums, and messages |
| fixtures/edition2023.proto | Test fixture demonstrating edition 2023 syntax and features |
| fixtures/edition2024.proto | Test fixture demonstrating edition 2024 syntax and features |
| fixtures/generate.go | Updates descriptor set generation to include new edition files |
| utils/protobuf_test.go | Updates test assertions to account for additional proto files in descriptor set |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Add edition detection methods: GetEdition(), IsEditions(), GetEditionName() - Add GetEditionComments() for accessing edition directive comments - Add feature detection methods: HasExplicitFieldPresence(), GetSyntaxType() - Enhance IsProto3() methods to maintain backward compatibility - Add edition comment extraction in parser (field path 14) - Create test fixtures for edition 2023 and 2024 syntax - Add test coverage for editions parsing, services, enums, and messages - Update descriptor set generation to include edition files - Fix utils tests to account for additional proto files - Reorganize types.go to follow code structure conventions
6131a9e to
47df112
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.