With the --file-lines option I'd expect to be able to partially format a function's signature, e.g. only format one argument while leaving the rest of the signature as-is. But any attempt to format the function signature formats the whole thing.
Summary
For the following code in test.rs:
fn long_fn_decl(
arg: i32,
arg2: i32,
arg3: i32,
)
{
println!("a");
}
I would like to use --file-lines '[{"file":"test.rs","range":[2,4]}]' to format just the arguments to the function, without modifying any other lines.
Expected behavior
fn long_fn_decl(
arg: i32,
arg2: i32,
arg3: i32,
)
{
println!("a");
}
Actual behavior
fn long_fn_decl(arg: i32, arg2: i32, arg3: i32) {
println!("a");
}
Configuration
rustfmt cli options used:
rustfmt --unstable-features --file-lines '[{"file":"test.rs","range":[2,4]}]' test.rs
With the
--file-linesoption I'd expect to be able to partially format a function's signature, e.g. only format one argument while leaving the rest of the signature as-is. But any attempt to format the function signature formats the whole thing.Summary
For the following code in
test.rs:I would like to use
--file-lines '[{"file":"test.rs","range":[2,4]}]'to format just the arguments to the function, without modifying any other lines.Expected behavior
Actual behavior
Configuration
rustfmtcli options used:rustfmt --unstable-features --file-lines '[{"file":"test.rs","range":[2,4]}]' test.rs