haskell-mode icon indicating copy to clipboard operation
haskell-mode copied to clipboard

[WIP] Use single session per stack project

Open corngood opened this issue 9 years ago • 5 comments

I have a stack project with a few local packages that I work on together. I found that haskell-mode would create a stack ghci process/buffer for each project, and each one would load all the projects, as stack ghci does.

This change defaults each module under the stack project to the same ghci instance.

What do you think? I haven't had any problems with it, and it saves a ton of memory for ghci processes, as well as simplifying work on multiple packages.

WIP because the buffer name is inconsistent with cabal, but using the package name on its own seems kind of fragile too... Maybe it should be the full path to the stack.yaml / .cabal with some sort of prefix?

TODO: share the file logic with (haskell-process-type)

corngood avatar Feb 22 '16 02:02 corngood

TODO: The directory for the ghci buffer ends up being set to the project where it is first created. It doesn't seem to matter to stack ghci, but having it run in the root of the stack project would be cleaner.

corngood avatar Feb 22 '16 02:02 corngood

Looks good to me. Ping us when you finish.

gracjan avatar Feb 22 '16 06:02 gracjan

It's working for my purposes, but it may be complicated by certain things assuming there is a cabal-dir per session (e.g. tag generation). I'll dig into it a bit more, but it's not as close to complete as I hoped.

I'll let you know.

corngood avatar Feb 23 '16 23:02 corngood

See also #1547.

purcell avatar Oct 22 '17 00:10 purcell

I support the idea behind this idea, would be great.

webdevred avatar Mar 11 '25 22:03 webdevred