1

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
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Heikki
  • 341
  • 2
  • 18
  • did you installed hls with ghcup?? – lsmor Jan 22 '23 at 16:45
  • Honestly I am not absolutely sure. However Haskell GHCup instalation website seems familiar. Also when I type ``ghcup`` in powershell I get ``The GHCup Haskell installer, version 0.1.19.0". So I asume I did. When I installed this I was following tutorial and didin't really understand what was the purpose and difference between different variants. Should I simply remove it and install it again? – Heikki Jan 22 '23 at 19:25
  • 1
    `ghcup` is a tool for managing all tooling related with haskell (compielr, language server, build tool, etc...). Try running `ghcup list -c installed` to see all tools and version installed in your system. If `hls 1.9.0.0` isn't one of them you should try `ghcup install hls 1.9.0.0 --set`. If version 1.9.0.0 is installed you could try uninstal it, and last resource, downgrade hls with `ghcup install hls 1.8.0.0 --set` and configure vscode extension to not upgrade the tooling automatically – lsmor Jan 22 '23 at 20:50
  • Thanks @Ismor I edited the question, but unfortunately this did not solve the issue even though it is a step ahead. For error in my edit suggest I tried to install ``ghc``. But all atemps on that account failed aswell. – Heikki Jan 22 '23 at 21:09
  • 1
    notice that the log says you tried to install `hsl`. The tool is `hls` (you swapped the `l` and `s`). Nevertheless, apparently is a anti-virus issue. – lsmor Jan 23 '23 at 07:52

1 Answers1

0

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.

Heikki
  • 341
  • 2
  • 18