Describe the bug
chain_width is documented as a stable option at https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#chain_width. However, it doesn't seem to exist as a configuration option. Am I misusing it?
To Reproduce
In a new project directory, create a file rustfmt.toml with these contents:
chain_width=10
In that directory, run cargo fmt.
Expected behavior
Formatting succeeds. Long function call chains are formatted on separate lines.
Actual behavior
A warning is printed:
Warning: Unknown configuration option `chain_width`
Long function call chains are formatted on one line.
Meta
rustup component add rustfmtcargo fmtThanks for the question @DumpsterDoofus . You are looking at the configuration options for the latest version of rustfmt in source (v2.x), but you are using a different version of rustfmt v1.4.18.
As mentioned in the Configurations.md file you referenced:
Below you can find a detailed visual guide on all the supported configuration options of rustfmt.
Note that the below list reflects the configuration options available on the latest version of rustfmt in source control. Some newer options may not be available yet in a released version of rustfmt.
For version- and channel-specific configurations, please visit https://rust-lang.github.io/rustfmt/.
Looks like the tag is missing for 1.4.18 but you can use this: https://rust-lang.github.io/rustfmt/?version=v1.4.20&search= to browse available options for the version of rustfmt you are using (there were no config changes between 1.4.18 and 1.4.20)
can we know if 2.0 is planned for 2020 or is there a roadmap somewhere?
Most helpful comment
Thanks for the question @DumpsterDoofus . You are looking at the configuration options for the latest version of rustfmt in source (v2.x), but you are using a different version of rustfmt v1.4.18.
As mentioned in the Configurations.md file you referenced:
Looks like the tag is missing for 1.4.18 but you can use this: https://rust-lang.github.io/rustfmt/?version=v1.4.20&search= to browse available options for the version of rustfmt you are using (there were no config changes between 1.4.18 and 1.4.20)