intellij-haskforce
intellij-haskforce copied to clipboard
Offer to setup external tools (ghc-mod)
Setting up tools, specifically ghc-mod, can be very complicated (#258), especially for new users. Ideally, HaskForce should offer to install and configure it for you when either it's not configured or misconfigured (e.g. ghc version does not match the configured ghc-mod version).
One prerequisite to make things easy might be to just require that the project is using stack. Otherwise, things get really complicated. A very simple way to do this with stack might be to temporarily create a "sandbox" directory with a stack.yaml file with the appropriate resolver and extra-deps for cabal-helper
. You could then just -
$ stack install ghc-mod --stack-yaml <path/to/stack.yaml>
And use the following to get the absolute path to ghc-mod to configure it -
$ stack exec -- which ghc-mod
Note on Windows we'll need to use where
instead of which
. There might be some other semantic differences between the two also.