-
Notifications
You must be signed in to change notification settings - Fork 19
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
How to preserve commas? #116
Comments
hi, do you have an example input and output to make sure we're talking about the same thing? Part of the optional configuration is documented on https://github.com/protocolbuffers/txtpbfmt/blob/master/docs/config.md. It seems we don't currently have a configuration to preserve commas. It is possible to add a new config to optionally preserve commas, let me know if you're interested in contributing it! You would need to change consumeOptionalSeparator on https://github.com/protocolbuffers/txtpbfmt/blob/master/parser/parser.go#L542 to store it in the AST. |
👋🏻 Sure, here's a minimal example. I made a script that changes something in an unrelated part of a config via parsing into an AST, changing it within the AST, and then dumping back to the file, and that removes all commas from the file. object {
- key: "hello",
- value: { foo: "bar", baz: "bin" }
+ key: "hello"
+ value: { foo: "bar" baz: "bin" }
} I'd expect this Unfortunately, I don't think I can put any time towards updating this in the near future. I will let you know if that changes! |
When I use this library to make a change in the AST, and then write it back to a file, I lose commas . This seems to be a standard part of the library, but I am wondering if there's a way to stop this?
The text was updated successfully, but these errors were encountered: