visual-studio-codehaskellghcuphaskell-language-server

`Haskell` extension for `VSCode` not working on `Linux`


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.


Solution

  • After around 10 tries, I managed to fix the problem. It turned out I had three problems:

      "haskell.serverEnvironment": {
        "PATH": "${HOME}/.ghcup/bin:$PATH"
      }
    
    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.

    I hope this helps.