platelk/vscode-dart

The dart formatter will run on non-dart files, wiping them.

Closed this issue · 2 comments

Hi, I recently downloaded your extension from the VS marketplace and I noticed that if I save a non-dart file, such as HTML, then it will be wiped by the dart formatter.

I think you need a file extension check, before formatting automatically.

I was able to work around this by opening the extension in ~/.vscode/extensions/kevinplatel.dart-0.0.5/out/src and editing dartFormat.js to first check the filePath argument before executing the dartfmt binary.

I also noticed the linter was being performed automatically on a save too, I would recommend changing that as well.

P.S: Took me a while to find this repo, as I randomly ran into it when clicking on your e-mail address in the README.md. You should add a link there so that people can find it and post issues.

Thanks.

Please, can you make a commit whit this fix or pull request with it?

Sorry for the delay, I will put much more effort on this extension in the near future because I'm not satisfy with Atom (the text editor, not the Dart extension) right now.

Sorry again for the delay, I will publish it on VSCode extension gallery