[英]`Haskell` extension for `VSCode` not working on `Linux`
I installed ghcup
and:我安装了
ghcup
并且:
All of them are the recommended versions(I verified it using ghcup tui
).都是推荐版本(我用
ghcup tui
验证过)。 Then I installed the Haskell
extension in VSCode
.然后我在
VSCode
中安装了Haskell
扩展。 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).我得到了语法高亮显示(来自
Haskell Syntax Highlighting
扩展,它似乎与Haskell
扩展一起自动安装)但没有 Intellisense,没有代码完成,没有错误检测,也没有交互模式( -->>>
评估)。 I experimented with different folders and haskell files.我尝试了不同的文件夹和 haskell 个文件。 The filetype is correct, because every time I open a
.hs
file, the Haskell extension checks for updates.文件类型是正确的,因为每次我打开
.hs
文件时,Haskell 扩展名都会检查更新。 I even installed Codium
, because I suspected a fault in VSCode
, but it was the same there as well.我什至安装了
Codium
,因为我怀疑VSCode
有问题,但那里也一样。
The hsl
language server doesn't seem to be working in Neovim, either. hsl
语言服务器似乎也无法在 Neovim 中运行。 I uninstalled ghcup
( ghcup nuke
) and reinstalled again.我卸载
ghcup
( ghcup nuke
) 并再次重新安装。 The result is exactly the same.结果完全一样。 I prepended the
PATH
and chose vanilla and non-vanilla Stack integration in either installations.我在 PATH 前面添加了
PATH
并在任一安装中选择了 vanilla 和非 vanilla Stack 集成。
Am I doing something wrong?难道我做错了什么?
OS: Linux Mint on Ubuntu 20.04.1
, kernel 5.15.0-56
.操作系统:
Linux Mint on Ubuntu 20.04.1
5.15.0-56
。
After around 10 tries, I managed to fix the problem.经过大约 10 次尝试,我设法解决了这个问题。 It turned out I had three problems:
结果我遇到了三个问题:
haskell-language-server
files were missing.haskell-language-server
文件丢失时,我意识到了。 I enlarged my Linux partition (something I should have done months ago).~/.ghcup/config.yaml
:~/.ghcup/config.yaml
来解决它: "haskell.serverEnvironment": {
"PATH": "${HOME}/.ghcup/bin:$PATH"
}
Haskell
VS Code extension but crashed 5 times and gave up on trying.Haskell
VS Code 扩展发现,但崩溃了 5 次并放弃了尝试。 Restarting it manually didn't help.View
-> Output
-> Haskell
and saw the error:View
-> Output
-> Haskell
并看到错误: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
.事实证明,我的 Linux Mint 发行版使用
GLIBC_2.31
,而不是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
.GLIBC_2.31
的HLS
版本。 This problem occured in September and was "fixed" but apparently not very well.HLS deb10
version manually (didn't work for me):HLS deb10
版本(对我不起作用): 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
).ghcup tui
HLS 版本1.7.0.0
(或使用您的glibc
版本的任何最新版本)和支持特定版本 HLS(在我的例子中为9.0.2
)的 GHC 下载。HLS
, so that its settings are restored to default.HLS
,以便将其设置恢复为默认值。 It takes up to 20 seconds to initialize the server, so be patient.Output
window and verify there are no more errors.Output
window 中发生了什么,并验证没有更多错误。 I hope this helps.我希望这有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.