-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of "Self" in stripped enum variants #997
Comments
The logic is already described in #179, the only missing cases are enum variants after prefix stripping. |
MixusMinimax
added a commit
to MixusMinimax/prost
that referenced
this issue
Mar 10, 2024
I have created a pull request at #998! |
github-merge-queue bot
pushed a commit
that referenced
this issue
Apr 9, 2024
* Address #997: handle keyword `Self` after stripping enum type prefix * create sanitize_identifier * add to_snake back (i did it in two commits to not mess up the git blame) * small fixes * add test_sanitize_identifier * remove unnecessary comment * combine test_strip_enum_prefix and test_strip_enum_prefix_resulting_in_keyword * update enum_keyword_variant.proto * maybe improve docs of strip_enum_prefix?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version: 0.12.3
Problem:
Generated enum variants are only sanitized for "Self", if prefix-stripping is not used, or does not apply.
Minimal reproducable protobuf defininition:
Reason:
The existing code does this:
FEEDING_SELF
intoFeedingSelf
Self
to replace withSelf_
Feeding
Feeding
toFeeding
Self
to replace withSelf_
Feeding
fromFeedingSelf
, resulting inSelf
The final result is
Self
, which is not sanitized after.The text was updated successfully, but these errors were encountered: