dart_style icon indicating copy to clipboard operation
dart_style copied to clipboard

Improve error message in sanity check

Open munificent opened this issue 2 years ago • 0 comments

If the formatter detects that it erroneously makes a non-whitespace change, it aborts with an exception asking users to file a bug. In many cases, the reason it gets into that situation is because syntactically invalid code was erroneously accepted by the parser without reporting an error, which the formatter then dutifully formats into something that is valid.

Updating the sanity check error message to suggest users double check that their code is correct might help them diagnose the problem.

See: https://github.com/dart-lang/sdk/issues/48664#issuecomment-1088771021

munificent avatar Apr 07 '22 00:04 munificent