Skip to content
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

Allow generated affixes for messages only or enums only #1151

Open
alextsg opened this issue Dec 13, 2024 · 3 comments
Open

Allow generated affixes for messages only or enums only #1151

alextsg opened this issue Dec 13, 2024 · 3 comments

Comments

@alextsg
Copy link

alextsg commented Dec 13, 2024

Similar to #1033. I have a use case where I want to add a prefix to messages only but not to enums. Would it be useful to introduce additional options like messagePrefix and enumPrefix? typePrefix and typeSuffix could take precedence if both options are passed in. If you think this would add value I could try putting up a PR for this.

@stephenh
Copy link
Owner

Hi @alextsg ! I mean, at this point we're shooting for the moon on the number of opts that ts-proto supports, so why not! 🤣 Some sort of affixEnums=true/false maybe?

@alextsg
Copy link
Author

alextsg commented Dec 13, 2024

🤣 thanks @stephenh . That would work for me but I was thinking messagePrefix/enumPrefix could be more flexible, in case other folks are looking to do the opposite and affix enums only and not messages, or have different prefixes/suffixes for messages vs enums.

@stephenh
Copy link
Owner

@alextsg ah I see, typePrefix is both, but messagePrefix / enumPrefix are the individual ones...yeah, that sgtm!

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

No branches or pull requests

2 participants