You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had an issue with format_code_in_doc_comments for some time and decided to finally try to fix it. The issue was that some of my examples did not get formatted.
While trying to implement a fix I managed to find the cause (#) and a workaround, but I'm not able to go further. A minimal repro here
and the fix being to increase max_width (in this example to 101)
Now, the line that is problematic is
/// # let long: Fooooooooooooooooooooooooooooooooo = Fooooooooooooooooooooooooooooooooo::hi();
however, that's only 94 characters in total starting from the start of the line, not from /// .
My expectation with #-hiding in rust examples is that it should not prevent this, and in fact, removing the # you can make the line as long as you want and the other code (and the long line) gets formatted.
The text was updated successfully, but these errors were encountered:
I think I know what's going on here, but need to investigate a little further. I'll follow up once I've had a chance to dive a little deeper into this.
I've had an issue with
format_code_in_doc_comments
for some time and decided to finally try to fix it. The issue was that some of my examples did not get formatted.While trying to implement a fix I managed to find the cause (
#
) and a workaround, but I'm not able to go further. A minimal repro herehttps://github.com/Emilgardis/rustfmt-no-format/blob/main/src/lib.rs
and the fix being to increase
max_width
(in this example to 101)Now, the line that is problematic is
however, that's only 94 characters in total starting from the start of the line, not from
///
.My expectation with
#
-hiding in rust examples is that it should not prevent this, and in fact, removing the#
you can make the line as long as you want and the other code (and the long line) gets formatted.The text was updated successfully, but these errors were encountered: