rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.32k stars 94 forks source link

Cannot import project with multiple stack files #210

Closed iand675 closed 5 years ago

iand675 commented 7 years ago

I have a project with multiple stack files:

When I try to import packages that have their own stack.yaml files as modules, they are ignored & nothing happens.

rikvdkleij commented 7 years ago

Only projects which have one stack file and multiple cabal files (Cabal file per directory) are supported. Like for example the Servant project.

So:

iand675 commented 7 years ago

Right, so I guess I'm making a feature request for supporting modules that need different stack.yaml files. I think a reasonable behavior would be to not just check the top level directory of the project when scanning for stack.yaml files, but to do it recursively and to use the most specific stack.yaml file for a directory (which is pretty much what stack itself does).

rikvdkleij commented 7 years ago

I was taking a look to your repo https://github.com/iand675/dd-middleware

In my opinon this repo contains 2 projects, so you have to create IntelliJ project for each subdirectory.

rikvdkleij commented 7 years ago

@iand675 Do you agree that each Haskell stack project can only have one stack file? Otherwise, for example, each module could have different GHC version or you could have conflicting dependencies.

rikvdkleij commented 7 years ago

@iand675 Any further comments?

iand675 commented 7 years ago

I would say that working in large monorepos it's not unheard of to have different projects started at different times be on different versions of GHC or things like that. It's quite inconvenient to have to run a separate instance of IntelliJ per project. I can understand if that isn't a priority for you, but it prevents me from using IntelliJ at work presently.

rikvdkleij commented 7 years ago

I'm used to run each project in a separate IntelliJ window (also in companies with big repos). I see no problem with that. Do you mean by separate instance of IntelliJ, a separate window?

I have to investigate if it is possible to support multiple Stack files in one IntelliJ Haskell project. It's anyway a difficult change....

rikvdkleij commented 5 years ago

Please reopen when it's still an issue.