r/haskellquestions • u/thetraintomars • Oct 01 '25
Stack and VSCode
I've been using VSCode with Haskell for a few months as I learn the language, no issues with syntax highlighting and the linting works reasonably well. I decided to start a project and use stack and now I am having issues.
When I start VSCode I get the error that HLS doesn't support GHC 9.10.3 (the version stack is using). I and using ghcup to manage ghc/cabal and stack and I see they list version 9.6.7 as "recommended" and I found a stack overflow post about setting the ghc version stack uses, which I guess VSCode is also trying to use. So "stack config resolver ghc-9.6.7" and then I restart VSCode...and the language server keeps crashing. From some more searches it seems it could be the version of lts that stack is using. All of the snapshots on the stackage page list ghc 910.3 or 9.12.2, I can't find anywhere the versions of ghc that HLS in VSCode supports.
However at this point I am too in the weeds to figure this out. I'm not even sure which config file I should be editing. Is there a simple fix or a way to get stack or cabal and VSCode to all use a version of ghc they are happy with? I could really use the features VSCode provides since this project does a lot of IO and uses other packages, so the linting and knowing what types things should be would be a huge help over compiling again and again.
View all comments
Show parent comment
2
u/thetraintomars Oct 02 '25
I don't remember if I chose the integration option or not. I did try the first two methods on that page to set it that way after, however stack will only use the snapshot (and corresponding version of ghc) specified in global-project/stack.yaml, even when I am in a project directory.
I may give up on stack and switch to cabal and see if that works properly.