Closed sir4ur0n closed 4 years ago
I will give it a try soon.
Would probably also solve path problems in Windows (https://github.com/rikvdkleij/intellij-haskell/issues/557).
I have given it a try but without success for now. The current way of setting up a Sdk does not support using an exe on the PATH
. I have asked for some support on the Jetbrains Slack channel.
Alternative solution could be to just skip creating a Sdk when stack is on the PATH
.... But that will mean that users have no choice anymore, when stack is on the PATH that one will be (implicitly) chosen.
Isn't it possible to setup an SDK with no path? E.g. with a checkbox "Use path". That would create an SDK with no path, and if it's used for a project, then look for Stack in path instead?
No, i'm constrained by how the IntelliJ SDK is working. Probably there is some way but that would be a completely custom solution and i don't know how to hook that into the IntelliJ SDK.
The "default" way expects a real absolute path and no way to edit it later. Tried different workarounds and went through the IntelliJ SDK code...
It's really tightly coupled code with no way to change in a way we want. So I asked for help.
The only solution which i can implement is to create in Haskell Settings an flag which indicates to use the stack exe in path (with some validation). So this is a workaround. It will ignore the stack path in Haskell Stack SDK.
Still sounds good to me!
Ok, other solution which is more consistent, is to remove the Haskell stack SDK and make stack as executable on the PATH a prerequisite of the plugin. So then user only has to indicate that the project is a Stack project.
What’s your opinion? For the last option I need some help with testing, especially on Windows.
Decided to remove the whole SDK solution. So prerequisite of the plugin will become that stack has to be on PATH.
Maybe in the future add Facets to support other tools like Cabal or make Nix support explicit.
Fixed in beta76.
Seems to work fine, thank you :bow:
@Sir4ur0n In beta78 I have reverted the change which removed the Haskell SDK. In the next version I will create a setting which indicates to use stack from PATH instead of SDK.
Hi,
In the same spirit as https://github.com/rikvdkleij/intellij-haskell/issues/485 could the intellij-haskell plugin use the
stack
executable in path? Or at least make it possible!This is for the same reason of using Nix (in my case, we package a custom Stack executable where Nix options are all passed). Currently I have to configure an ugly path like
/nix/store/g14h563bs6r1s9vrd1dgrald6pg2895q-stack/bin/stack
, but this path may change whenever I change some configuration in mystack
wrapper...AFAICT this would be the last bit to have a better support for Nix with Intellij :sweat_smile:
Cheers!