-
Notifications
You must be signed in to change notification settings - Fork 11
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
Tango comments <-> rustfmt interaction #9
Comments
I have been thinking more about this since you told me about it on twitter. I could extend tango to allow whitespace between the The fact that rustfmt will introduce line breaks into long comment lines seems unfortunate. I guess I could change tango so that it will break such lines itself during the md->rust trip, and then reassemble them into a single line during the rust->md trip (by making the follow-on lines have a marker like I am not terribly thrilled with the idea of introducing either change by default, but since the design of tango is that it is invoked as a library function, not a command line executable, it seems like I could just make these choices user-selectable. E.g. put them into options and then perhaps also offer modes like "Max RustFmt Compatibilty" vs "Preserve-Line-Structure". |
(If you ask me, though, I think
then I think it would be more reasonable for |
Considering that rustfmt rewrites the source completely and stores the orginal comment header, this seems like a feasible option. https://github.com/rust-lang-nursery/rustfmt/blob/master/src/comment.rs#L23-L56 |
Feel free to weigh in here: rust-lang/rustfmt#1179 |
Hey @skade is this still an issue, or has |
I can confirm that |
Closing as no longer a significant bug |
cargo fmt works quite well with tango because of the bidirectional source mapping, except for one aspect: comments.
There's two issues:
rustfmt will destroy tango comments:
//@
will become
// @
It will also destroy these blocks when fixing overlong comment lines:
//@ This is a very long line that breaks < here
will become
Breaking the source mapping.
A desired outcome would be that
cargo build && cargo fmt && cargo build
yields a clean tango file.The text was updated successfully, but these errors were encountered: