adamwathan / sublime-phpunit

Run individual unit test files directly from Sublime
281 stars 43 forks source link

Add option to save all files before running tests #25

Closed jwalton512 closed 9 months ago

jwalton512 commented 7 years ago

I often run the test command without having saving test file (or some other file) first. This optional value will allow users to have all unsaved files saved before running tests.

As this is an additional configuration option, also started a table of configuration options in the readme.

davidhemphill commented 7 years ago

Hi @jwalton512! Thanks for the PR.

What would this provide over the built-in Sublime option which saves all unsaved files on lost focus?

"save_on_focus_lost": true

jwalton512 commented 7 years ago

Hi @davidhemphill. It doesn't add anything over it per se. I don't, however, use "save_on_focus_lost": true just because I run into issues where, for example, a sass file is saved prematurely which triggers automated build tools, etc, which is a mild annoyance. And this can occur just from switching quickly to a different application.

Generally, when I attempt to run my test suite, any open unsaved file is unsaved because I forgot to save it first. That could just be my own personal experience though.

davidhemphill commented 7 years ago

Yeah, makes sense. I've done this a few times myself and it's kind of annoying.

I'm not really keen on the new configuration table. I kind of like giving folks a simple copy/paste-able json configuration with some trailing comments. What do you think @adamwathan?

adamwathan commented 7 years ago

I think this would be better solved by creating a macro in Sublime that saves all file and then runs one of our commands, instead of baking it into this package. I've personally never experienced this problem but I don't leave a tab without saving, so it makes me wonder if it's generally better solved by workflow changes instead of package changes. I worry that this would solve one class of problems and introduce a class of new problems. I sometimes have a tab open that I'm using as a notepad really; something that's never been saved and I don't intend to save. Or maybe some output I copied from somewhere else to be able to manipulate, paste somewhere else, then delete.