Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

formatOnSave requires extra save #56

Open
stephenkubovic opened this issue Nov 12, 2016 · 6 comments · May be fixed by #57
Open

formatOnSave requires extra save #56

stephenkubovic opened this issue Nov 12, 2016 · 6 comments · May be fixed by #57
Labels

Comments

@stephenkubovic
Copy link
Contributor

#55 fixed the package crash on Atom 1.12.x, but it also introduced a bug with the formatOnSave option. Since the transform operation is now async, the save operation saves the untransformed text, and then the text is replaced with the transformed text, resulting in you needing to save a second time.

@stephenkubovic
Copy link
Contributor Author

I am not sure how to solve this, as the onWillSave callback is called synchronously - there's no way to interrupt the save operation (which is probably a good thing).

@jcready
Copy link
Contributor

jcready commented Nov 13, 2016

The standard-format, semistandard-format, and happiness-format packages all seem to run synchronously. So if you change this.style to one of those instead of standard then the format on save feature should work.

@jcready jcready linked a pull request Nov 13, 2016 that will close this issue
@evollu
Copy link

evollu commented Dec 6, 2016

how about just run standard --fix on this file and let the command update file directly? can atom pick up the change from file automatically?

@joseluisq
Copy link

joseluisq commented Jan 11, 2017

👍

@hutch120
Copy link

+1 Would be great to see this fixed.

@MarceloPrado
Copy link

+1!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants