dart-vim-plugin
dart-vim-plugin copied to clipboard
DartFmt deletes everything from the buffer
- Win10
- gVim/vim 8.1.2269
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.
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.
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.
same issue win 10 gvim8.2