-
Notifications
You must be signed in to change notification settings - Fork 1k
file-lines can't partially format function signatures #6868
Copy link
Copy link
Open
Labels
C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEUO-file_linesUnstable option: file_linesUnstable option: file_linesneeds-triageThis issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.This issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.
Metadata
Metadata
Assignees
Labels
C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEUO-file_linesUnstable option: file_linesUnstable option: file_linesneeds-triageThis issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.This issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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