Skip to content
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

wrap_comments can break up type links #5260

Closed
PSeitz opened this issue Mar 11, 2022 · 2 comments · Fixed by #5262 · May be fixed by #5331
Closed

wrap_comments can break up type links #5260

PSeitz opened this issue Mar 11, 2022 · 2 comments · Fixed by #5262 · May be fixed by #5331
Labels
a-comments only-with-option requires a non-default option value to reproduce

Comments

@PSeitz
Copy link
Contributor

PSeitz commented Mar 11, 2022

Similar to #5250, I have a problem when addressing types. They get split over multiple lines and are not valid links anymore in rust doc.

/// [IntermediateBucketResult](crate::aggregation::intermediate_agg_result::IntermediateBucketResult) 

This is converted to:

/// [IntermediateBucketResult](crate::aggregation::intermediate_agg_result::
/// IntermediateBucketResult) 
@ytmimi
Copy link
Contributor

ytmimi commented Mar 11, 2022

Thanks for the report!

We fixed wrapping reference style links back in #5096. As a workaround for now you might consider rewriting the link as:

/// [IntermediateBucketResult]
/// [IntermediateBucketResult]: crate::aggregation::intermediate_agg_result::IntermediateBucketResult

I Imagine we could take a similar approach to the one introduced in that PR and add another regular expression check for the [bar][Bar] and [bar](Bar) link syntax.

PSeitz added a commit to PSeitz/rustfmt that referenced this issue Mar 12, 2022
Fixes rust-lang#5260 by checking if it is part of a type '::'
Add possibility to run single test
This was referenced Mar 12, 2022
@PSeitz
Copy link
Contributor Author

PSeitz commented Mar 12, 2022

Thanks, but I'd like to hide the path to the type.
I created a PR to fix this issue

@calebcartwright calebcartwright added the only-with-option requires a non-default option value to reproduce label Mar 12, 2022
PSeitz added a commit to PSeitz/rustfmt that referenced this issue Mar 13, 2022
Fixes rust-lang#5260 by checking if it is part of a type '::'
PSeitz added a commit to PSeitz/rustfmt that referenced this issue Mar 13, 2022
Fixes rust-lang#5260 by checking if it is part of a type '::'
PSeitz added a commit to PSeitz/rustfmt that referenced this issue Apr 28, 2022
Fixes rust-lang#5260 by checking if it is part of a type '::'
PSeitz added a commit to PSeitz/rustfmt that referenced this issue May 2, 2022
Fixes rust-lang#5260 by checking if it is part of a type '::'
calebcartwright pushed a commit that referenced this issue May 8, 2022
Fixes #5260 by checking if it is part of a type '::'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments only-with-option requires a non-default option value to reproduce
Projects
None yet
3 participants