6

Context:
I run a Windows machine, and I've installed the Haskell Toolchain using GHCup. Initially, I selected "Y" to all the options mentioned during setup. Stack, Cabal, ghc (8.10.7 - recommended) worked and were/are on path (installation reference link attached at the end).

Sample Project Structure ("stack new project"):
enter image description here

Problem:
The Haskell Language Server Extension does not give me Intellisense. It did, for a brief moment after my first install, but never again.

Things I've tried that did not work:

  1. Letting VS Code manage HLS via GHCup, to upgrade whenever, but to no avail.
    enter image description here

  2. Tried reinstalling everything, but that hasn't worked either.

  3. Using the latest/same version of ghc that came with ghcup stack. (stack ghc -- -version = 9.0.2, ghc --version = 9.0.2)

Note: I did do the following commands too, with varying combinations (but in some logically dependent order)

  • ghcup install ghc 9.0.2 (and latest)
  • ghcup unset ghc 8.10.7
  • ghcup set ghc 9.0.2 (and latest)
  • ghcup rm ghc 8.10.7

All I end up getting is this cryptic message (shown below. "testing-p" is the project name).

enter image description here

Installation Reference:
https://betterprogramming.pub/haskell-vs-code-setup-in-2021-6267cc991551

nassqra
  • 351
  • 1
  • 3
  • 14
  • Okay so standalone Haskell files work with the Haskell HLS extension. However, cabal or stack based builds don't work – nassqra May 08 '22 at 16:51
  • 1
    I needed to compile HLS for my specific GHC version using `ghcup compile hls -v --ghc ` –  May 21 '22 at 15:20
  • I did try that command, however ghcup said that it had trouble resolving dependencies, any idea as to how I should proceed? Also, assuming that this compilation does work (in the future for me), do I have to then set the HLS path inside VS Code for the haskell extension? – nassqra Oct 24 '22 at 12:15

0 Answers0