Closed Anabra closed 6 years ago
Haskell-tools does not recognize a change until you save the file.
This might be uncomfortable for users. Do you think a popup asking if you want to save the file before refactoring should be useful?
In my opinion a pop-up would be annoying. I think there should an option for this in the settings menu. Also there should be some short explanation under that option, why this is needed.
"Automatically save the file before refactoring" checkbox -- By turning this option on, you can perform refactorings on an unsaved file.
Honestly, that should be the default behaviour, so we wouldn't have to explain it to users. My suggestion is that enable auto-saving by default, and give the users an option to disable it:
"Disable auto-saving before refactoring" checkbox -- If you disable auto-saving, you can't refactor unsaved files.
By implementing this behaviour, the extra pop-up message seems more useful. So if the user disabled auto-saivng, and tries to refactor an unsaved file, give them a message saying that:
"Can't refactor unsaved files. Turn-on auto-saving to enable it."
Check out the latest commit: https://github.com/nboldi/haskell-tools-atom/commit/22ec75e7ee811c4997625a86ca6636c4d335748e
Works perfectly.
Cannot perform refactoring after modifying the file but not saving it.