麻烦使haskell扩展名进行VS代码工作

发布于 2025-02-13 01:55:26 字数 853 浏览 0 评论 0原文

我在Windows 10上使用VS代码1.68.1,并安装了Haskell语言支持插件。我试图安装GHCUP,但是安装脚本只是失败而没有错误消息,而IRC频道#GHCUP无法帮助您,因此我已经放弃了GHCUP,并决定手动处理此操作。我刚刚安装了HLS 1.7.0并指向代码。问题是我从VS代码中收到一条错误消息:

ghcide compiled against GHC 9.2.2 but currently using 8.6.5 
This is unsupported, ghcide must be compiled with the same GHC version as the project.

经过进一步调查,这似乎是在抱怨使用GHCIDE库是HLS的一部分,使用GHC 9.2.2 构建,但我的当前代码库是构建的(通过堆栈)使用GHC 8.6.5。至少这是我的阅读,因为HLS页面本身说1.7.0与8.6.5兼容!因此,我的第一个问题是我应该如何知道使用哪种版本的GHC来构建HLS,老实说我为什么要关心?我的第二个问题是,如何找到与当前GHC兼容的HLS版本?

(另一个选项是将堆栈从8.6.5迁移到9.2.2,但我不确定如何做到这一点。出现只是在stack.yaml中更改分辨率条目的一种情况。当前是resolver:LTS-14.21。 href =“ https://www.stackage.org/lts-19.14” rel =“ nofollow noreferrer”> https://www.stackage.org/lts-19.14.14 我有点紧张。该页面上的更改为GHC 9.0.2不是9.2.2。足以堆叠不想最终带有混乱的堆栈配置,并且可能会在Haskell软件包中不匹配

I am using VS Code 1.68.1 on Windows 10 and have installed the Haskell language support plugin. I tried to install ghcup but the installation script just fails with no error message and the IRC channel #ghcup wasn't able to help so I've given up on ghcup and decided to handle this manually. I just installed HLS 1.7.0 and pointed VS Code at it. The problem is I get an error message from VS Code:

ghcide compiled against GHC 9.2.2 but currently using 8.6.5 
This is unsupported, ghcide must be compiled with the same GHC version as the project.

Upon further investigation, this seems to be complaining that the ghcide library that's a part of HLS was built using ghc 9.2.2 but my current codebase was built (by Stack) using ghc 8.6.5. At least that's my reading of it, since the HLS page itself says that 1.7.0 is compatible with 8.6.5! So my first question is how on earth am I supposed to know what version of ghc was used to build HLS, and honestly why should I care?? And my second question is, how do I find the version of HLS that's compatible with my current ghc?

(Another option is to migrate Stack from 8.6.5 to 9.2.2 but I'm not sure exactly how to do this. It appears to be just a case of changing the resolver entry in stack.yaml which is currently resolver: lts-14.21. But what do I change it to? It looks like the most recent version of LTS is 19.14 https://www.stackage.org/lts-19.14. But I'm a bit nervous about making that change since the page says ghc 9.0.2 not 9.2.2. The entire Haskell ecosystem just seems really finicky and I'm new enough to Stack that don't want to end up with a messed up Stack config and possibly in Haskell package mismatch hell.

Can anyone offer any good solutions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文