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
Hello! I recently ran into an issue where comments weren't wrapping if there was a URL in the comment; after looking deeper into the documentation, turns out this is expected behavior!
The comment is the start of a markdown header doc comment
An URL was found in the comment
A previous discussion on this can be found at #5634, there seemed to be no conclusive action on this other than adding this behavior to the documentation.
Adding this by default or having some sort of additional configuration set in rustfmt.toml to enable this would be great.
Thanks!
The text was updated successfully, but these errors were encountered:
This behavior is intentional, and as mentioned in #5634 (comment), this behavior helps prevent other issues. If you'd like you can introduce line breaks manually, and rustfmt shouldn't modify them.
@ytmimi I see that wrap_comments no functioning when a URL is detected is the current intended behavior, but I think the OP is asking for wrap_comments to still wrap the block, but just don't break the URL across multiple lines(ie. if the url puts it over the width limit, the line break should be inserted before the url. Would a behaviour change like that be accepted?
Hello! I recently ran into an issue where comments weren't wrapping if there was a URL in the comment; after looking deeper into the documentation, turns out this is expected behavior!
From the documentation:
A previous discussion on this can be found at #5634, there seemed to be no conclusive action on this other than adding this behavior to the documentation.
Adding this by default or having some sort of additional configuration set in rustfmt.toml to enable this would be great.
Thanks!
The text was updated successfully, but these errors were encountered: