ide-haskell-cabal package provides a build backend for
package based on
It supports easy switching between multiple versions of GHC by having a set of configuration settings for each version of GHC, plus a drop-down box to pick a GHC version. For each GHC version you can specify:
--builddirparameter). This defaults to
It also provides support for build target selection by reading and parsing the cabalfile and extracting the available targets (it uses a thin
ghcjs-compiled wrapper around the
Cabal library to read the
When you first try building your project (by running
ide-haskell-cabal:build command from command palette, for example), you will be asked to specify a builder to use:
You can select one you’d like to use then. Atom will remember your choice. If you wish to choose another builder afterwards, you can do this by running
ide-haskell-cabal:set-active-builder command. Alternatively, this same command is available in Haskell IDE -> Builder -> Set Active Builder menu item, or via a
🔨 button on ide-haskell panel:
Currently-selected builder is also shown on that exact button, either as button text, or as tooltip (this is configurable from package settings).
You can also select which target (of the ones defined in cabalfile) to build. You can do that by either running
ide-haskell-cabal:set-build-target command, choosing Haskell IDE -> Builder -> Set Build Target menu item, or clicking the
🎯 button on ide-haskell panel:
If you do, you will be presented with the list of all available targets in all currently-open Atom project directories:
Before ide-haskell-cabal v2.1.0,
Auto targets were confusingly called
All, and there were no actual
Default setting is
Auto: Auto, which will automatically select which project and which target to build based on currently-active editor.
Each detected project directory also has target
Auto in addition to targets defined in cabalfile. That target constrains automatic selection algorithm to selected project directory, but the target for that project is selected based on currently-active editor.
Finally, each detected project directory has a special target
All, which will build all targets for selected project.
Ide-Haskell-Cabal comes with little pre-specified keybindings, so you will need to specify your own, if you want those.
You can edit Atom keybindings by opening Edit → Keymap…. Here is a template for all commands, provided by ide-haskell-cabal:
'atom-workspace': '': 'ide-haskell-cabal:build' '': 'ide-haskell-cabal:clean' '': 'ide-haskell-cabal:test' '': 'ide-haskell-cabal:bench' '': 'ide-haskell-cabal:deps' # builds only dependencies '': 'ide-haskell-cabal:set-build-target' '': 'ide-haskell-cabal:set-active-builder'