Add `doc_comment_code_block_small_heuristics`, to override `use_small_heuristics` in doc code
This (unstable) configuration option allows overriding use_small_heuristics for doc code. This is particularly useful for code that wants to use use_small_heuristics = "Max" internally but present doctests and examples using use_small_heuristics = "Default".
This has come up before in the context of formatting the standard library, which uses use_small_heuristics = "Max" internally, but wants to present documentation and examples in the style most people will normally see.
is doc_comment_code_block_width not enough to override the width settings when formatting code blocks?
@ytmimi No, because if you're using use_small_heuristics = "Max", then the equivalent of doc_comment_code_block_small_heuristics = "Default" would require manually setting all the other widths that "Max" overrode.
It wasn't originally clear to me but now I understand. You want a way to override all width settings when formatting code blocks in doc comments.
It wasn't originally clear to me but now I understand. You want a way to override all width settings when formatting code blocks in doc comments.
Or in this case un-override them, yes.
I'm hoping to use this in rust-lang/rust, to be able to use the standard style in the standard library documentation.
@ytmimi Done.
Checking in on this: I'd love to use this (as an unstable flag) in a PR to format doc code blocks for std.