vscode-rust icon indicating copy to clipboard operation
vscode-rust copied to clipboard

Silent formatting failures when rustfmt can't fix a problem

Open acdha opened this issue 8 years ago • 0 comments

Version of VSCode: 1.15.1 Version of the extension: 0.2.2 OS: macOS 10.12.6

Description:

I ran into a problem where it seemed like formatting was broken – “Format Document” and formatOnSave did nothing and there was no UI indication that anything had gone wrong. A quick rustfmt on the command-line showed a problem which couldn't be fixed automatically (in this case a long FIXME: comment in a struct defintion):

Rustfmt failed at …/src/main.rs:74: line exceeded maximum length (maximum: 100, found: 118) (sorry)

Output of the "Rust logging" channel:

[Error - 3:51:34 PM] Request textDocument/formatting failed.
  Message: Reformat failed to complete successfully
  Code: -32603 

So obviously this could be detected by thinking to check the RLS logging channel but it'd be nice if there was some UI badging even if it was something more basic than badging the lines which couldn't be formatted.

acdha avatar Aug 23 '17 19:08 acdha