Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode rust format on save line length

    "rust-analyzer.checkOnSave.command": "clippy",
    "[rust]": {
        "editor.defaultFormatter": "rust-lang.rust-analyzer",
        "editor.formatOnSave": true
    },

I have these rust settings in vscode. They work fine for formatting, but the line length is shorter than I'd like. Is there a way I can adjust the max line length?

like image 860
Brandon Kauffman Avatar asked Feb 06 '26 07:02

Brandon Kauffman


1 Answers

Put a rustfmt.toml at the project root (rust-analyzer respects it), and use rustfmt settings:

max_width = <number you'd like>
like image 149
Chayim Friedman Avatar answered Feb 09 '26 03:02

Chayim Friedman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!