Haskell in VSCode
2023-06-22 00:59 作者:sxlxcsxlxc | 我要投稿
原来 haskell.org/ghcup 提供的脚本不知为何总遇到网络问题没法完成安装,于是在linux下在VSCode配置haskell就及其麻烦
首先想办法安装ghcup,但是他很想让你用ghc 9.2.8,不过 tui里面可以安装的Haskell language server并不支持9.2.8 要自己编译,不过 ghcup compile 命令因为同样的网络原因无法执行,vscode的haskell插件如果使用ghcup配置的话一样会非常想让你用 9.2.8, 遗憾的是这个版本无论是ghcup当中的hls 1.10还是2.0.0.0 都不支持。最简单的办法是,用默认的hls+受支持版本的ghc。
注意脚本没有运行成功,需要手动把.ghcup/bin 添加到PATH,或者source .ghcup/env
https://haskell-language-server.readthedocs.io/en/latest/support/ghc-version-support.html
vscode中配置
{
"haskell.toolchain": {
"ghc": "9.6.1"
}}