You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use stack/cabal cradle if no project config + ghc not in PATH + stack/cabal in PATH #692
Thinking in it twice, there exists the possibility of use cabal, as you can set in cabal global config the path to ghc without having it in the global PATH. Not sure if that is a common setup though.
Maybe we should check if cabal exec ghc -- --version works (and in a similar way stack exec ghc -- --version, maybe with --skip-ghc-check to avoid its download?) and proceed to use cabal or stack if ghc is set.
I have to say that it arose in a conversation with a haskell beginner (@hieung1401 in the fp discord channel), who was using directly stack for fire a repl.
He had to create a stack project only to make hls work. But even experienced haskell developers work with standalone files so it can be handy for everybody.
Yes, true. I installed system GHC only to make HLS work for small scripts that I need to use from time to time. If HLS supports such a stack detection mechanism, it would allow much compact setting for Haskell dev.
changed the title [-]Use stack cradle if no project config + ghc not in PATH + stack in PATH[/-][+]Use stack cradle if no project config + ghc not in PATH + stack/cabal in PATH[/+]on Dec 22, 2020
changed the title [-]Use stack cradle if no project config + ghc not in PATH + stack/cabal in PATH[/-][+]Use stack/cabal cradle if no project config + ghc not in PATH + stack/cabal in PATH[/+]on Dec 22, 2020
I would say that cabal could not be as useful as stack cause you can configure the stack global project as you want, including dependencies, but afaik you cant do the same in the global cabal config, only set the path to ghc.
So in this case i would choose stack first if both tools are available.
it is a common issue among beginners so probably we should add it as konwn issue in troubleshooting section
I did really met some students with this problem, especially some of them following the instruction from the class but not installed correctly(they thought they had made it), which cause HLS unable to work.
It seems using the following explicit cradle works:
cradle:
stack:
Save this as hie.yaml into the directory, and just use open VSCode without custom PATH. I assumed this configuration should be able to force hls to call stack, and it works pretty well.
Activity
Avi-D-coder commentedon Dec 21, 2020
I can take a look on Christmas.
jneira commentedon Dec 22, 2020
Thinking in it twice, there exists the possibility of use cabal, as you can set in cabal global config the path to ghc without having it in the global
PATH. Not sure if that is a common setup though.Maybe we should check if
cabal exec ghc -- --versionworks (and in a similar waystack exec ghc -- --version, maybe with--skip-ghc-checkto avoid its download?) and proceed to use cabal or stack if ghc is set.Ailrun commentedon Dec 22, 2020
Awesome, this is exactly what I have hoped for a few weeks, but couldn't come up with some specification. Thank you for raising this issue!
jneira commentedon Dec 22, 2020
I have to say that it arose in a conversation with a haskell beginner (@hieung1401 in the fp discord channel), who was using directly stack for fire a repl.
He had to create a stack project only to make hls work. But even experienced haskell developers work with standalone files so it can be handy for everybody.
Ailrun commentedon Dec 22, 2020
Yes, true. I installed system GHC only to make HLS work for small scripts that I need to use from time to time. If HLS supports such a stack detection mechanism, it would allow much compact setting for Haskell dev.
[-]Use stack cradle if no project config + ghc not in PATH + stack in PATH[/-][+]Use stack cradle if no project config + ghc not in PATH + stack/cabal in PATH[/+][-]Use stack cradle if no project config + ghc not in PATH + stack/cabal in PATH[/-][+]Use stack/cabal cradle if no project config + ghc not in PATH + stack/cabal in PATH[/+]jneira commentedon Dec 22, 2020
I would say that cabal could not be as useful as stack cause you can configure the stack global project as you want, including dependencies, but afaik you cant do the same in the global cabal config, only set the path to ghc.
So in this case i would choose stack first if both tools are available.
Code action: remove redundant constraints for type signature (#692)
Merge ghcide repository (replacing the submodule) (#702)
jneira commentedon Jan 19, 2021
@Avi-D-coder has you the opportunity to make some progress on this?
1 remaining item
jneira commentedon Apr 8, 2021
it is a common issue among beginners so probably we should add it as known issue in troubleshooting section
July541 commentedon Apr 8, 2021
I did really met some students with this problem, especially some of them following the instruction from the class but not installed correctly(they thought they had made it), which cause HLS unable to work.
RedTachyon commentedon Oct 8, 2021
Is there an end-user solution for this? I'm trying to setup Haskell on a new machine and running into this problem again
jneira commentedon Oct 8, 2021
I am afraid that no other than set ghc in path (f.e. with
PATH=$(stack path --compiler-exe):PATH && code .)Or if you are using ghcup: https://ghcup.readthedocs.io/en/latest/guide/#with_ghc-wrapper-eg-for-hls
ruifengx commentedon Feb 3, 2022
It seems using the following explicit cradle works:
Save this as
hie.yamlinto the directory, and just use open VSCode without customPATH. I assumed this configuration should be able to forcehlsto callstack, and it works pretty well.