ndmitchell / ghcid

Very low feature GHCi based IDE
Other
1.13k stars 114 forks source link

Question about supporting projects which contain of multiple stack components #325

Closed rikvdkleij closed 4 years ago

rikvdkleij commented 4 years ago

I was looking for a way to use ghcid as a way get faster feedback in the IntelliJ-Haskell plugin (especially for larger projects which contain of multiple components).

The plugin starts per component a REPL which makes life hard to get them all in sync especially in larger projects (even when only doing rebuilds for lib components). Because when a lib component is changed, it has to be rebuild and the dependent REPL has to be restarted to notice the changes).

I experienced that ghcid was much faster in reloading (rebuilding) but it loads all components at once. My question is: does that not give conflicts because of the possible different ghc options and default language extension per component?

ndmitchell commented 4 years ago

Yes, it sometimes gives conflicts because of different options, libraries, overlapping module names, extensions - pretty much everything. Although, in practice, often the only conflicting module name is Main, and within a set of related components, most other things seem to be mostly compatible. It's definitely not ideal!

Note that Ghcide has a multi-component approach, where it loads all components together, but carefully enables/disables different bits on a per file basis. That is likely to offer a better long-term solution.

rikvdkleij commented 4 years ago

Thanks for your reply!

Because goal of the plugin is that it should be easy to install and to use, i try to prevent dependencies, especially large ones as Ghcide, but who knows in the future 😄 ghcid is a small library and easy to build.

First want to try to put all Lib components in one REPL. Same for Exe, Test and Benchmark components. As you said that's not an ideal solution but if that works in most cases then that's the most pragmatic solution on the short term.