-
Notifications
You must be signed in to change notification settings - Fork 161
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
save all modified files before running the checks or reloading the configuration #562
Conversation
That is a brilliant insight - it would explain why I could never reproduce it, as my auto-save settings are generally fairly aggressive, and I tend to window switch a lot when testing. Thank you! Even if it doesn't solve all of it, it definitely closes off one path to it 🤞 I'm going to take a little longer to think on this though - I'm tending towards that we should probably only save the relevant rules file, rather than everything, as otherwise we're shortcutting expected behaviour. And I know there are some use-cases where people don't want files saved unexpectedly (e.g. if they have something watching for FS changes). |
Hi - take your time, at least I now know some workaround. Although saving all files might look a bit too much at first sight, some thoughts why it might be the right thing to do:
While saving just the right files is hard, saving all of them is a lot simpler. |
This is determinable, given we have to do it at runtime, but you're not wrong on it being a bit of a pain in the arse.
There's actually a joyous path of writing out temp files for unsaved documents (in the correct package structure), to ensure we can scan them. So this, at least, should be taken care of. One fallback might be to offer a pop-up on reload saying "unsaved files, do you want to save", with a checkbox to do it automatically in future 🤔 Presumably most would click "do it", and those with odd requirements have an opt-out. |
Sorry, this has all been delayed due to the issues with the mutli-selection PR, which are hopefully now sorted 🤞 My thinking is currently that the perfect answer is a checkbox to opt in, but it's probably too much hassle. So what I instead suggest is that we do this only for the "reload configuration" action - the other actions have logic to create on-disk copies without saving (which we need for the inspection if nothing else), so those should already work as intended - and people taking the reload action are explicitly resyncing with the FS, so it shouldn't be so surprising. |
Hmm, I also suggest we template a sub-method for the base class, rather than relying on people calling |
4feda88
to
48348f0
Compare
Thanks you for these guiding comments. As this is now only necessary for I pushed some changes. |
Smashing - thanks very much! |
This might fix #459.
I noticed the problem that the configuration wasn't reloaded even after clicking the button. This now saves all modified files to disk first, and then runs the check.