vscode-haskell icon indicating copy to clipboard operation
vscode-haskell copied to clipboard

Better error message when trying to use an unsupported ghc version

Open Timmmm opened this issue 4 years ago • 1 comments

I just installed Haskell on a Mac using ghcup, and said "yes" when asked to install the language server. It installed these:

.ghcup/bin/haskell-language-server-8.10.2
.ghcup/bin/haskell-language-server-8.10.2~1.3.0
.ghcup/bin/haskell-language-server-8.10.3
.ghcup/bin/haskell-language-server-8.10.3~1.3.0
.ghcup/bin/haskell-language-server-8.10.4
.ghcup/bin/haskell-language-server-8.10.4~1.3.0
.ghcup/bin/haskell-language-server-8.10.5
.ghcup/bin/haskell-language-server-8.10.5~1.3.0
.ghcup/bin/haskell-language-server-8.6.4
.ghcup/bin/haskell-language-server-8.6.4~1.3.0
.ghcup/bin/haskell-language-server-8.6.5
.ghcup/bin/haskell-language-server-8.6.5~1.3.0
.ghcup/bin/haskell-language-server-8.8.3
.ghcup/bin/haskell-language-server-8.8.3~1.3.0
.ghcup/bin/haskell-language-server-8.8.4
.ghcup/bin/haskell-language-server-8.8.4~1.3.0
.ghcup/bin/haskell-language-server-9.0.1
.ghcup/bin/haskell-language-server-9.0.1~1.3.0
.ghcup/bin/haskell-language-server-wrapper
.ghcup/bin/haskell-language-server-wrapper-1.3.0

However when I try to use this extension it crashes with a not very helpful error message (#429) because:

haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Cannot find any haskell-language-server exe, looked for: haskell-language-server-8.10.7, haskell-language-server

Not the best beginner experience!

Timmmm avatar Sep 08 '21 13:09 Timmmm

Hi, agree in the error message could be improved. The cause is the actual release of the lsp server (haskell-language-server) does not support ghc-8.10.7, next one will do. You can check the supported versions in the README: https://github.com/haskell/vscode-haskell#supported-ghc-versions

To improve the error message and be precise we should encode the supported versions in the code itself and remember to update each time we do a server release. Maybe there is another way though, pr's welcomed!

jneira avatar Sep 09 '21 05:09 jneira

I think the error message has been improved. Closing, feel free to reopen or open a new one if there is something left to do.

fendor avatar May 11 '23 12:05 fendor