ghc-mod icon indicating copy to clipboard operation
ghc-mod copied to clipboard

Support the STACK_YAML environment variable (or add --stack-yaml)

Open pjones opened this issue 9 years ago • 2 comments

Stack allows you to specify an alternate location for the stack.yaml file using the --stack-yaml command line option or the STACK_YAML environment variable. I don't like to clutter up the root directory of my repositories so I store my stack.yaml files in a build directory.

ghc-mod should allow you to specify an alternate location for the stack.yaml file using either a new command line option or by respecting the STACK_YAML environment variable.

It's actually recommended in the stack documentation to have multiple YAML files if you want to support multiple resolvers. This would be another motivation for supporting alternate stack configuration files in ghc-mod.

pjones avatar Feb 01 '16 02:02 pjones

This should be very easy to add. Here is the code that looks for stack.yaml: https://github.com/DanielG/ghc-mod/blob/19b3de356928f7c1a7aa3a59430beae08a883e7b/Language/Haskell/GhcMod/PathsAndFiles.hs#L75

The path isn't used anywhere we only use this to check for it's existence and invoke stack directly for everything else. So all you need to do is insert the appropriate logic there and it should work.

DanielG avatar Feb 02 '16 02:02 DanielG

PR forthcoming.

pjones avatar Feb 09 '16 21:02 pjones