-
Notifications
You must be signed in to change notification settings - Fork 109
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
Format drops comments between items in a table #818
Comments
Yes,
Overall, this seems better suited for a heavier weight manifest formatting tool, with related configuration, rather than expecting the TOML parser / formatter to do it all. Within Cargo, the approach we've taken is
The last part is modeled off of Even when there isn't a manifest formatter yet, like in Cargo's case, I think its still helpful to be naive about formatting so you don't throwaway formatting from the user which is especially important for users to see the diff of what the machine generated change was. |
## Summary If you look at Ed's reply [here](toml-rs/toml#818 (comment)), it sounds like we're being too heavy-handed in applying `.fmt()`. I think I added this to handle an issue with inline tables whereby we were inserting a space after a trailing comma? So now I'm just applying `.fmt()` to inline tables, which don't allow comments between elements anyway. Closes #9758.
Below,
# one
and# two
are dropped by calling.fmt()
:The text was updated successfully, but these errors were encountered: