No Syntax Highlighting in VSCode on Windows

I’ve been away from Haskell for a few years and have run into some issues when trying to set things up on a new Windows machine.

After installing everything except for HLS via ghcup and installing the Haskell extension in VSCode, I chose the ‘manage through ghcup’ option since I thought I remembered that as being recommended. After opening a test .hs file I first noticed that there was no syntax highlighting in the file, although -- >>> evaluations and compiler suggestions worked. I closed VSCode hoping that a restart would fix the problem, but when I reopened the file the extension told me that I needed to download an older version of HLS, which kept happening for older and older versions each time I restarted.

Changing the settings of the extension did not help, nor did uninstalling and reinstalling it. I also tried using ghcup to make sure only the latest version of HLS was installed and selected, but that didn’t solve the issue either.

Eventually I deleted everything in ~\AppData\Roaming\Code\User\globalStorage, not just the Haskell directory, and when I reinstalled the extension chose to use PATH to manage HLS. This has the extension working again, but I still have no syntax highlighting (with Haskell, other languages have no problem). I also want to reiterate that this is a completely new install, I have no other extensions in VSCode and installing the Haskell extension was the first thing I did when I opened it so I doubt it’s a conflicting configuration.

I am appreciative of any suggestions people may have, thanks.

2 Likes
2 Likes

The Haskell Syntax Highlighting extension was a dependency of the Haskell extension up until the last release, so it used to be installed automatically when installing the Haskell extension but now you have to install it separately. The maintainers are looking into ways to improve the experience:

3 Likes