Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for interaction with stack ghci. #746

Merged
merged 1 commit into from
Jul 4, 2015

Conversation

johnwalker
Copy link
Contributor

Add stack ghci support from #744. Also fix a defcustom typo in haskell-process-args-cabal-repl.

gracjan added a commit that referenced this pull request Jul 4, 2015
Add support for interaction with stack ghci.
@gracjan gracjan merged commit 4c3cdfd into haskell:master Jul 4, 2015
@gracjan
Copy link
Contributor

gracjan commented Jul 4, 2015

Thanks.

@swsnr
Copy link

swsnr commented Jul 10, 2015

Mmh, it seems that haskell-process-cabal-build (e.g. C-c C-c) doesn't understand stack yet, does it?

@johnwalker
Copy link
Contributor Author

Thats right. For now, look to the bottom of https://github.com/chrisdone/chrisdone-emacs/blob/master/config/haskell.el

I think thats the right approach for haskell-mode, too?

@peti
Copy link
Contributor

peti commented Sep 2, 2015

Has anyone figured out a good way to switch easily between stack and cabal projects? (My emacs-fu is very weak, so it's quite possible that there's a simple and obvious solution that I'm unaware of). When I set haskell-process-type to auto, stack projects aren't recognized, unfortunately.

@srhb
Copy link

srhb commented Sep 13, 2015

The only way I've found is to use a .dir-locals.el on an ad-hoc basis, which doesn't feel very nice. I'd settle for a menu when I start a haskell process, really.

@gracjan
Copy link
Contributor

gracjan commented Sep 13, 2015 via email

@srhb
Copy link

srhb commented Sep 13, 2015

I should have been more specific, because you're obviously right. It's a sane default to not ask too many questions. I guess I just want the option for a menu (because when you switch between cabal sandboxes, nix and stack, there's no good solution currently.)

@gracjan
Copy link
Contributor

gracjan commented Sep 13, 2015 via email

@peti
Copy link
Contributor

peti commented Sep 13, 2015

Auto-detection cannot be 100% reliable, but IMHO it can be pretty good:

  1. If the top-level directory relative to the current source module contains a stack.yaml file, then it's Stack.
  2. If that directory contains a Cabal file and the directory layer above contains a stack.yaml file that mentions the Cabal file in its packages section, then it's Stack.
  3. If there is a Cabal file but no Stack file, then it's Cabal.
  4. If everything else fails, just load ghci.

@ivan-m
Copy link
Contributor

ivan-m commented Sep 13, 2015

@peti except that falls through in the case of "this project has stack support, but I don't want to use it" (e.g. cloned from upstream, but you're still using cabal), which is why I believe the current 'auto' option checks if there's stack.yaml and stack is in the PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants