VSCode 中 Haskell 语言服务器的不稳定行为

Jiv*_*van 7 haskell haskell-stack

Haskell在 Visual Studio Code 上安装了扩展。这个扩展下载并安装了 Haskell 语言服务器,并且没有明显的原因,有时它工作得很好,有时却没有。

当它工作时,扩展能够对代码中的实时更改做出反应,突出显示各种错误、警告等,并即时显示功能文档。完美的东西。

但是,当它不起作用时,它会不断将每个模块文件的第一行高亮显示为错误,并指出:

Multi Cradle: No prefixes matched
pwd: /Users/jivan/haskell-descriptions
filepath: /Users/jivan/haskell-descriptions/src/Proceed.hs
prefixes:
("./src/Main.hs",Stack {component = Just "haskell-descriptions:exe:descriptions", stackYaml = Nothing})
Run Code Online (Sandbox Code Playgroud)

内容hie.yaml如下:

Multi Cradle: No prefixes matched
pwd: /Users/jivan/haskell-descriptions
filepath: /Users/jivan/haskell-descriptions/src/Proceed.hs
prefixes:
("./src/Main.hs",Stack {component = Just "haskell-descriptions:exe:descriptions", stackYaml = Nothing})
Run Code Online (Sandbox Code Playgroud)

它实际上是用来工作,而不component部分hie.yaml,但现在我无法得到它的工作,无论是component部分在不在。

有人告诉我,gen-hie但没有办法让它成功运行,因为当我gen-hie在终端中输入时,我得到的答案是command not found: gen-hie(尽管它在stack.yaml.cabal文件中都声明了)。

欢迎任何想法或建议。