Why did HSL extension stop working on VS Code?

526 Views Asked by At

I am using Windows 11. I've been using Haskell with VS Code. Suddenly yesterday it stopped giving me problems section (one that displays syntax errors and such before code is compiled). I am using Haskells own extension (ID: haskell.haskell).

I am not entirely sure, but it might be that Haskell Language Server is causing the issue. Every time I start VS Code, disable / re-enable, uninstall and install, it will prompt me this: enter image description here

Obviously I hit "Yes". Then this is displayed for a fraction of a second and this disappears without any fail or pass message: enter image description here

I am not keen on installing it manually, since it worked before and it should again.

Edit:

As suggested by @Ismor I checked ghcup list -c installed. It gave me this info:

[ Warn  ] New cabal version available. If you want to install this latest version, run 'ghcup install cabal 3.8.1.0'
[ Info  ] verifying digest of: gs.exe
   Tool  Version  Tags                      Notes
IS ghc   9.2.5    recommended,base-4.16.4.0
IS cabal 3.6.2.0  recommended
I  stack 2.9.3    latest
IS ghcup 0.1.19.0 latest,recommended

As hsl was not in the list I tried ghcup install hsl 1.9.0.0 --set which gave me:

[ Warn  ] This is an old-style command for installing GHC. Use 'ghcup install ghc' instead.
[ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.4.4'
[ Warn  ] New cabal version available. If you want to install this latest version, run 'ghcup install cabal 3.8.1.0'
[ Info  ] verifying digest of: gs.exe
[ Error ] [GHCup-07140] Both installation and setting the tool failed. Install error was: Unable to find a download for the requested version/distro.
[ ...   ] Set error was: The version hsl of the tool ghc is not installed.
[ Error ] Also check the logs in C:\ghcup\logs
1

There are 1 best solutions below

0
On

For now I got the end result I wanted, but I am not quite sure what was the problem. Anyway I installed the ghc again, but I had to disable my antivirus before that. After that hsl was already installed and I only had to reload the extension from VS Code.

I would guess that there it was trying to update hsl and my antivirus messed up the update for some reason. I remember that when installing Haskell in the first place it required me to momentarily disable my antivirus. But take that with a large grain of salt, because I deffinetly am not sure about that.