Skip to content

Commit

Permalink
fix: support for editions
Browse files Browse the repository at this point in the history
  • Loading branch information
sudorandom committed Aug 9, 2024
1 parent df44d47 commit 055cfff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/converter/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,15 @@ func Convert(req *pluginpb.CodeGeneratorRequest) (*pluginpb.CodeGeneratorRespons
})
}

features := uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
features := uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) | uint64(pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS)
minimumEdition := int32(descriptorpb.Edition_EDITION_PROTO2)
maximumEdition := int32(descriptorpb.Edition_EDITION_MAX)
return &pluginpb.CodeGeneratorResponse{
File: files,
Error: new(string),
SupportedFeatures: &features,
MinimumEdition: &minimumEdition,
MaximumEdition: &maximumEdition,
File: files,
}, nil
}

Expand Down
2 changes: 2 additions & 0 deletions internal/converter/fixtures/editions_2023.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
edition = "2023";

package editions;

option features.enum_type = CLOSED;

message Person {
Expand Down

0 comments on commit 055cfff

Please sign in to comment.