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
With vscode extension rust-analyzer, the (visual) line width in editor might not the same as the width in text file.
e.g.
fnf(very_very_very_very_long_arg_1:i32,very_very_very_very_long_arg_2:i32){}fnmain(){f("1".parse().expect("true"),"2".parse().expect("true"));// what rustfmt see}
with rust-analyzer it would be rendered as
fnmain(){f(very_very_very_very_long_arg_1:"1".parse().expect("true"), very_very...:"2".parse().expect("true"));// what we see}
which is much longer.
The question here is not that rustfmt would not turn this f("1".parse().expect("true"), "2".parse().expect("true")); into vertical format, it is about rustfmt would shrink my vertical formatting version into oneline.
// I write it vertically, after `cargo fmt` it would be forced be into one linefnmain(){f("1".parse().expect("true"),"2".parse().expect("true"),);}
I think we should add an option like no_force_same_line that rustfmt would only break long line but not combine lines, so that when I explicitly write vertical formatting code, rustfmt would leave it as is.
The text was updated successfully, but these errors were encountered:
With vscode extension
rust-analyzer
, the (visual) line width in editor might not the same as the width in text file.e.g.
with rust-analyzer it would be rendered as
which is much longer.
The question here is not that rustfmt would not turn this
f("1".parse().expect("true"), "2".parse().expect("true"));
into vertical format, it is aboutrustfmt
would shrink my vertical formatting version into oneline.I think we should add an option like
no_force_same_line
thatrustfmt
would only break long line but not combine lines, so that when I explicitly write vertical formatting code, rustfmt would leave it as is.The text was updated successfully, but these errors were encountered: