atom-haskell / ide-haskell

Haskell IDE plugin for Atom editor
https://atom.io/packages/ide-haskell
Other
233 stars 30 forks source link

Styling code asks for re-save #205

Closed varosi closed 7 years ago

varosi commented 7 years ago

Steps to reproduce

  1. Change the code so it needs restyling by stylish-haskell (add some import)
  2. Ctrl + S to Save the file
  3. File is restyled and asks for second save

It'll be good on Ctrl + S (Save) to save the restyled version and don't ask for second save. And the build/ghc-mod/HLint processes to start over restyled version and not the intermediate.

Windows 10 x64 and ide-haskell 1.9.6 plug-in and Atom 1.16.0

ArtemKonichek commented 7 years ago

I use HIndent and experience the same behavior, but I don't think this is an issue. Sometimes prettifyer does some unexpected things :) So I'm pleased to be able to undo the changes that it made.

Windows 7 x64, ide-haskell 1.9.6, Atom 1.17.2

varosi commented 7 years ago

It's good to be a undoable, but this should be ortogonal to saving.

lierdakil commented 7 years ago

Since v2.0.3, ide-haskell should automatically re-save file after prettifying. It's not an ideal solution, but Atom doesn't allow to defer saving until some async action finishes, and running external program in sync doesn't sound like a particularly good idea, even were it not a challenge (and it is)