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

Support disabling/overriding ConvertToCamelCase #58

Open
Rohansi opened this issue Mar 7, 2023 · 2 comments
Open

Support disabling/overriding ConvertToCamelCase #58

Rohansi opened this issue Mar 7, 2023 · 2 comments

Comments

@Rohansi
Copy link

Rohansi commented Mar 7, 2023

I upgraded to the new source generator version of this and it is no longer valid to write a protobuf message for Unity engine types like Vector3.

//:namespace = UnityEngine
//:type = struct
//:external
message Vector3 {
	optional float x = 1 [default = 0];
	optional float y = 2 [default = 0];
	optional float z = 3 [default = 0];
}

Unity does not use camel case for Vector3 fields so, after upgrading, there is no way to make this work because the source generator doesn't allow ConvertToCamelCase to be disabled and I can't go and change Unity builtin types.

@hultqvist
Copy link
Collaborator

Would a custom NuGet package with ConvertToCamelCase set to false be an option?
Or perhaps a per message option like //:case = none?

@Rohansi
Copy link
Author

Rohansi commented Mar 16, 2023

Per-message option sounds good for special cases like this. I agree that converting to camel case is a good default because that's C# style but it's unfortunate that Unity doesn't follow that.

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