I installed ghcup
and:
All of them are the recommended versions(I verified it using ghcup tui
). Then I installed the Haskell
extension in VSCode
. Unfortunately, it doesn't work. I get syntax highlighting (from the Haskell Syntax Highlighting
extension, which seems to be automatically installed alongside the Haskell
extension) but there is no Intellisense, no code completion, no error detection and no interactive mode (-->>>
evaluation). I experimented with different folders and haskell files. The filetype is correct, because every time I open a .hs
file, the Haskell extension checks for updates. I even installed Codium
, because I suspected a fault in VSCode
, but it was the same there as well.
The hsl
language server doesn't seem to be working in Neovim, either. I uninstalled ghcup
(ghcup nuke
) and reinstalled again. The result is exactly the same. I prepended the PATH
and chose vanilla and non-vanilla Stack integration in either installations.
Am I doing something wrong?
OS: Linux Mint on Ubuntu 20.04.1
, kernel 5.15.0-56
.
After around 10 tries, I managed to fix the problem. It turned out I had three problems:
haskell-language-server
files were missing. I enlarged my Linux partition (something I should have done months ago). The new installation installed all files~/.ghcup/config.yaml
: "haskell.serverEnvironment": {
"PATH": "${HOME}/.ghcup/bin:$PATH"
}
Haskell
VS Code extension but crashed 5 times and gave up on trying. Restarting it manually didn't help. I opened the logs: View
->Output
->Haskell
and saw the error:haskell-language-server-wrapper: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by haskell-language-server-wrapper)
It turns out, my Linux Mint distribution uses GLIBC_2.31
, not 2.32
. This is a very important library, which most applications on the system use. If you are a newbie, it is strongly advised that you DO NOT update it manually.
HLS
, which used GLIBC_2.31
. This problem occured in September and was "fixed" but apparently not very well. There are two options:
HLS deb10
version manually (didn't work for me):ghcup install hls -u https://downloads.haskell.org/~hls/haskell-language-server-1.8.0.0/h
ghcup tui
HLS version 1.7.0.0
(or whatever newest, which uses your glibc
version) and a GHC, which supports that particular version of the HLS (in my case 9.0.2
).HLS
, so that its settings are restored to default. It takes up to 20 seconds to initialize the server, so be patient. You can see what's happening in the Output
window and verify there are no more errors.I hope this helps.