Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Rustfmt failed with wsl #610

Open
thymbahutymba opened this issue Jun 25, 2019 · 6 comments
Open

Rustfmt failed with wsl #610

thymbahutymba opened this issue Jun 25, 2019 · 6 comments
Labels
wsl Issue related to WSL - Windows Subsystem for Linux

Comments

@thymbahutymba
Copy link

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?

@Xanewok Xanewok added the wsl Issue related to WSL - Windows Subsystem for Linux label Jun 27, 2019
@Xanewok
Copy link
Member

Xanewok commented Jun 29, 2019

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?

@chbdetta
Copy link

chbdetta commented Jul 6, 2019

With remote - WSL extension, the document format still doesn't work.

@thymbahutymba
Copy link
Author

Same problem here

@robrecord
Copy link

Same issue here. On macOS

@lnicola
Copy link
Member

lnicola commented Jul 4, 2022

@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).

@robrecord
Copy link

Thank you @lnicola - I appreciate this. I am new to rust.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wsl Issue related to WSL - Windows Subsystem for Linux
Projects
None yet
Development

No branches or pull requests

5 participants