Stack and haskell-language-server, instructions unclear

I set up a new stack project and would like to use haskell-language-server with it. I’m not sure how to install it, however. I’m on an Ubuntu system, and, of course, install my ghc via stack. The release notes for 1.7.0.0 of hls say:

If you get your GHC binaries from a source other than https://downloads.haskell.org (or GHCup), then you will need to build HLS from source yourself.

Is that true, or is there a quicker solution when I use stack?

I think the easiest way is using GHCup - you can still use stack (you can even use GHCup to install stack if you like)

If you use VS Code the Haskell plugin will even ask you if you’d like to use GHCup to handle this for you.

1 Like

Thanks ghcup seems really easy and I was able to install everything with it.

1 Like

And I think then you will want to disable stack’s ghc installing system, so as not to duplicate ghcup’s. This should be in the various docs if it’s not already: in ~/.stack/config.yaml:

install-ghc: false
system-ghc: true

IIRC

2 Likes

I’m not sure but I think ~stack used to check the path for compatible GHC versions and use it if it’s the right one in the past.~

No sorry - you are right - see the Stack docs

1 Like

Got it, thanks for the hint!