Skip to content
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

Open
habamax opened this issue Nov 9, 2019 · 4 comments
Open

DartFmt deletes everything from the buffer #93

habamax opened this issue Nov 9, 2019 · 4 comments

Comments

@habamax
Copy link

habamax commented Nov 9, 2019

  • Win10
  • gVim/vim 8.1.2269

vim-dartfmt

@cbracken
Copy link
Member

cbracken commented Nov 9, 2019

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.

@habamax
Copy link
Author

habamax commented Nov 9, 2019

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.

@habamax
Copy link
Author

habamax commented Nov 9, 2019

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.

It actually happens for all dart files, even the simplest hello world from dart examples.

@Chaitanyabsprip
Copy link

same issue
win 10
gvim8.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants