Format not work #534
Comments
I just started learning Rust with VSCode and rls-vscode plugin and got the same error. To check what is the error message, click View > Open View and write Output (panel) then press Enter. |
Unfortunately, this is an issue with RLS itself. That's high on the list so hopefully this will be soon resolved |
Is the upstream issue rust-lang/rls#1397? |
Any update about this issue? |
I don't get an error, but I format does nothing on my end either |
I got the same error. |
Hi there Issue a "cargo fmt" from within your project dir. This will give more information why formatting can not be used. |
I have the same issue and "cargo fmt" works fine, no error when I run from the command line. It used to work until very recently within VSCode too, now I get the error reported above every time. |
Same here,
I am using
I also noticed that the |
I have one machine running VS Code 1.37 that works properly, and another running 1.38.1 that does not work, so it looks like it was a regression from the earlier issue. |
A simple warning for the fellow newbies who are just starting to learn Rust like me. It seems that you need a Cargo.toml file in your project so that |
Not working for me even with a Edit: working after all - Prettier was being used incorrectly due to being set as the default formatter in my VS Code settings |
I get the same error when rustfmt fails. In my case this seems to be related to this issue from rustfmt. In particular this code cause rustfmt to fail: match var.name{
name if
//BAD COMMENT causes fmt error
name.contains("smth")
// other comment
| name.contains("smth else") => {true}
_ => false,
} The caused rls error is quite silent. Initially I checked the settings and updated rust with rustup (which was of no help).
|
Since I do no longer expect this to get fixed, I propose to install |
Using rust-analyzer (the stand-alone extension) should also work. |
If your rust-analyzer does not work try adding this to your settings.json
|
Hi!
I can not get vscode to format code, the error is:
rustftm via cmd formats same file ok.
what to check or configure?
thank you!
rustc 1.33.0 (2aa4c46cf 2019-02-28)
rustfmt 1.0.1-stable (be13559 2018-12-10)
cargo 1.33.0 (f099fe94b 2019-02-12)
rustup 1.17.0 (069c88ed6 2019-03-05)
The text was updated successfully, but these errors were encountered: