-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DartFmt deletes everything from the buffer #93
Comments
Thanks for reporting this! This used to be the case when there was a syntax error in the Dart code but I thought we’d fixed this a while back. Specifically the reason I remember it happening before was that dartfmt relies on the analyzer package to build an AST, and in the case where there’s a syntax error the analyzer couldn’t parse it, so dartfmt would exit with no output. I thought we’d fixed that by only doing the replacement if the exit code was zero. Hard to tell if there’s a syntax error in the above code from my phone — I assume there’s a closing curly bracket on main() that’s offscreen — but either way that shouldn’t be happening. Will see if I can repro. If it turns out to be Windows-specific I’ll probably need some help as I don’t have access to a Windows machine. |
Sure, let me know what to do. |
It actually happens for all dart files, even the simplest hello world from dart examples. |
same issue |
The text was updated successfully, but these errors were encountered: