vscode-rust
vscode-rust copied to clipboard
Rustfmt failed with wsl
I'm trying to format my code pressing ALT+SHIFT+F but i get the following error
[Error - 10:51:44] Request textDocument/formatting failed.
Message: Reformat failed to complete successfully
Code: -32603
Here the rust configuragion in my setting.json
"rust-client.useWSL": true,
"rust-client.revealOutputChannelOn": "info",
"rust-client.rustupPath": "~/.cargo/bin/rustup",
Using cargo fmt from wsl terminal works correctly. What I'm missing?
Hey, thanks for the report!
WSL support is deprecated now and Remote - WSL extension should be used instead. Could you try setting it up and seeing if it works there?
With remote - WSL extension, the document format still doesn't work.
Same problem here
Same issue here. On macOS
@robrecord your issue seems unrelated (because you're not using WSL), but you should probably try https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer, see https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html.
You'll need to install rustfmt if you don't already have it (rustup component add rustfmt).
Thank you @lnicola - I appreciate this. I am new to rust.