atom-haskell / ide-haskell

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

Bench target needs manual build #191

Closed almays closed 3 years ago

almays commented 7 years ago

When I change cabal file, adding new dependencies, IDE is downloading and building new packages in the background. So when I do import some module from freshly added dependency, I see no errors.

But in bench target, when I add criterion or something to the dependencies of a benchmark, then no background build happens. And import turns into error. If I run stack bench, then all needed packages get downloaded and built and then import stops being an error.

Is there any way to enable benchmarks as autoconstructed builds as well as tests, executables and lib?

lierdakil commented 7 years ago

The fact of the matter is that ghc-mod unconditionally runs stack build --only-dependencies. Currently unreleased master disables this by default, and once it is live, it would become possible to prompt user for a build (and also build relevant parts of the package).

As of right now, only workaround I can suggest is selecting 'auto' target in ide-haskell-cabal-v1.8.0, and run ide-haskell-cabal:build-dependencies (or simply ide-haskell-cabal:build) when a bench file is open.