Skip to content

Conversation

@pseudomuto
Copy link
Owner

  • 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

@pseudomuto pseudomuto requested a review from Copilot October 21, 2025 14:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@pseudomuto pseudomuto merged commit c9e5558 into master Oct 21, 2025
3 checks passed
@pseudomuto pseudomuto deleted the support_editions branch October 21, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants