haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 212 forks source link

How to set the HIE to use stack/cabal for the current project #1674

Closed leofisG closed 4 years ago

leofisG commented 4 years ago

In my current project I have both stack and cabal configuration file, however, how do I set up HIE so that it only uses say stack?

The problem here is that if it uses the other one it won't be able to work properly. My current workaround is temporarily deleting the cabal.project file so that it always uses stack.

Thanks for the help!

fendor commented 4 years ago

Hi! To tell HIE to always use stack, use a hie.yaml file! https://github.com/haskell/haskell-ide-engine#project-configuration

leofisG commented 4 years ago

Thanks for the response! But it seems like setting up the hie.yaml` can be quite tedious if we have multiple components, e.g. more than 15 components. So I am wondering is there any more efficient way to do this?

fendor commented 4 years ago

No, currently not. A fix would be to implement https://github.com/haskell/haskell-ide-engine/issues/1516, which should be quite trivial. There you can tell cabal-helper which build-tool to use.

jneira commented 4 years ago

Another one could be add a cli flag to tell hie prefer one over another: https://github.com/haskell/haskell-ide-engine/issues/1432 (and a vscode config option)