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
In #3535 the option got renamed to format_code_in_doc_comment. With that maybe now is a good time to go through the stabilisation process for this option.
Reacted by Dan Kolsoi, Diana Popa, Jelte Fennema-Nio, Ian Chamberlain, Adam Emerson, Justin Moon and manu3618
This option is great. Would it be possible to use this to fix #2036 as well?
One thing I did notice is that it doesn't format code that is hidden by prefixing it with a #. It's not terrible but it would be nice if that was also formatted. So in this example the foo function is not formatted:
/// ```rust/// # fn foo() {if false{println!("hello")} // this function will be hidden/// println!("Hello, World!");/// ```
One thing I did notice is that it doesn't format code that is hidden by prefixing it with a #. It's not terrible but it would be nice if that was also formatted. So in this example the foo function is not formatted:
@JelteF It's somewhat tricky to figure out the corresponding lines between the input and the output:
In #3535 the option got renamed to format_code_in_doc_comment. With that maybe now is a good time to go through the stabilisation process for this option.
I'd really like to see this feature stabilized. Are there any plans regarding it?
Reacted by Ian Chamberlain, Alexandra Iordache, Jon Gjengset, David Laehnemann, Adam Emerson, Justin Moon, Thomas B, Mateusz Maćkowski, Azzam S.A, Trevor Gross and 2 more
One thing I would really like with this is a separate max_width setting. It appears it is using the standard max_width (not even the comment_width) but I much prefer using a max width of ~60 columns in examples as the space they are shown in in the documentation is commonly limited.
EDIT: Actually, playing around with changing max_width and comment_width don't seem to affect this at all.
Activity
[-][unstable option] unstable option: format_doc_comments[/-][+][unstable option] format_doc_comments[/+]carllerche commentedon May 10, 2019
What is left to stabilize this?
shepmaster commentedon May 14, 2019
Running this seemed to work well for me!
carllerche commentedon May 14, 2019
I would like to use this as part of tokio and other crates, but I am hesitant to include unstable features at this point.
scampi commentedon May 16, 2019
In #3535 the option got renamed to
format_code_in_doc_comment. With that maybe now is a good time to go through the stabilisation process for this option.JelteF commentedon Nov 2, 2019
This option is great. Would it be possible to use this to fix #2036 as well?
One thing I did notice is that it doesn't format code that is hidden by prefixing it with a
#. It's not terrible but it would be nice if that was also formatted. So in this example thefoofunction is not formatted:topecongiro commentedon Nov 5, 2019
@JelteF It's somewhat tricky to figure out the corresponding lines between the input and the output:
In the above example we need to add
#prefix to cover the entirefn foo() { ... }.dianpopa commentedon Jan 20, 2020
I'd really like to see this feature stabilized. Are there any plans regarding it?
format_doc_comments -> format_code_in_doc_comment
Merge #212
format_doc_comments -> format_code_in_doc_comment
Nemo157 commentedon Oct 6, 2020
One thing I would really like with this is a separate
max_widthsetting. It appears it is using the standardmax_width(not even thecomment_width) but I much prefer using a max width of ~60 columns in examples as the space they are shown in in the documentation is commonly limited.EDIT: Actually, playing around with changing
max_widthandcomment_widthdon't seem to affect this at all.[-][unstable option] format_doc_comments[/-][+][unstable option] format_code_in_doc_comment[/+][-][unstable option] format_code_in_doc_comment[/-][+][unstable option] format_code_in_doc_comments[/+]11 remaining items
docs: enable `rustfmt` for doc comments (#187)
format_code_in_doc_commentsnot applied when containing macros which takes an abstract stream of tokens #6454/// # #![rustfmt::skip]behaves weird #6098format_code_in_doc_commentsshould not touch non-rust code blocks #6609format_code_in_doc_commentsadds empty line between trailing comment and hidden code #6612#-hiding line #5627