-
Notifications
You must be signed in to change notification settings - Fork 27
call to stack / get-cabal-configuration delays editing file #108
Description
On a typical day at work I load 10-30 cabal projects, and the first file I open in each takes ~ 4 seconds to load. I have flycheck-haskell-setup in my haskell-mode-hook, so I cannot view or edit the file until the call to stack runghc get-cabal-configuration.hs` completes. I think it would be better if this slow call were non-blocking, so I can edit the file immediately, and flycheck errors will catch up.
Another approach would be to make get-cabal-configuration faster, by pre-compiling, changing its code, or both. In one test, I found that compiling took ~2s, and running took ~2s (6s / 1.3s with -O2, which is probably a better idea). I suspect a 1s pause will still annoy me, so I think the async change will have better ROI.
I'm testing a patch locally that makes this call async. If you like the idea, I can clean it up and open a PR once I've used it for a few days. In which case, a few questions about how you want the code:
- is async an acceptable dependency?
- Is it reasonable to assume that
get-cabal-configurationonly prints toSTDERRif it exits with a non-success error code, so I can let emacs mixSTDOUTandSTDERRand just check the exit code?
The patch I'm running now assumes yes to both, which makes the change smaller.