简体   繁体   English

在 Archlinux 上使用 Vim 作为 Haskell 的 IDE 目前情况如何?

[英]What is the current situation for using Vim as IDE for Haskell on Archlinux?

My target, if doable, is to have command completion for Haskell in work in Vim, via YouCompleteMe.如果可行,我的目标是通过 YouCompleteMe 在 Vim 中完成 Haskell 的命令完成。 In this respect, as you can see in the following, I haven't found a consesus yet about how to get it to work.在这方面,正如您在下面看到的,我还没有找到关于如何让它工作的共识。

The latest comments on a relevant issue on YouCompleteMe are not that old, therefore I installed haskell-ide-engine from the AUR (the repo on GitHub is here . YouCompleteMe上相关问题的最新评论并没有那么旧,因此我从AUR安装了haskell-ide-engine (GitHub上的repo是here

However, since it was taking so long (it took 110 minutes!) I checked the PKGBUILD file just to discover this:但是,由于它花了很长时间(花了 110 分钟!)我检查了PKGBUILD文件只是为了发现这一点:

# ...
# Supported are '8.4.2' '8.4.3' '8.4.4' '8.6.4' '8.6.5' '8.8.1' '8.8.2' '8.8.3'
# activated by default are the ones also used in a stackage snapshot. Removing
# versions you do not use will greatly reduce the compilation time of this
# package
_enabled_ghc_versions=('8.4.4' '8.6.4' '8.6.5' '8.8.2' '8.8.3')
# ...

Fair enough, my bad.够公平,我的坏。 So I searched for help on the #haskell IRC channel , and one user made this comment:所以我在#haskell IRC 频道上寻找帮助,一位用户发表了这样的评论:

and then you find out that hardly anybody uses haskell-ide-engine anymore but haskell-language-server .然后你会发现除了haskell-language-server几乎没有人使用haskell-ide-engine了。 and also that ghcup can install the prebuild binaries for you并且 ghcup 可以为您安装预构建二进制文件

a comment from another user was来自另一个用户的评论是

the haskell situation on Arch is not optimal, to say the least至少可以说,Arch 上的 Haskell 情况不是最佳的

an yet another comment (from Fendor, his answer is already below) was另一个评论(来自 Fendor,他的回答已经在下面)是

HIE is not actively developed anymore. HIE 不再积极开发。 Haskell Language Server is the successor. Haskell 语言服务器是继任者。 I would recommend Haskell Language Server我会推荐 Haskell 语言服务器

which seems not in line with what you can read on YouCompleteMe issue tracker .这似乎与您在YouCompleteMe issue tracker上阅读的内容不一致

So what is the situation at the moment?那么目前的情况如何呢?

Haskell IDE Engine and Haskell Language Server developer here. Haskell IDE 引擎和 Haskell 语言服务器开发人员在这里。

It is true, Haskell IDE Engine is not actively being developed anymore.确实,Haskell IDE Engine 不再被积极开发。 The teams of ghcide and Haskell IDE Engine have merged their efforts and created Haskell Language Server (based on ghcide as the main driver). ghcide和 Haskell IDE Engine 团队合力打造了 Haskell Language Server(以 ghcide 为主要驱动)。 Thus, Haskell Language Server is currently the focus of development and we recommend you prefer it over Haskell IDE Engine, as it is quicker and more stable.因此,Haskell Language Server 目前是开发的重点,我们建议您更喜欢它而不是 Haskell IDE Engine,因为它更快更稳定。 It also has a bunch of new features and will soon reach feature-parity with Haskell IDE Engine.它还具有许多新功能,并且很快将达到与 Haskell IDE 引擎相同的功能。

Haskell Language Server can be installed via ghcup, and the VSCode plugin Haskell can install the binaries automatically as well. Haskell Language Server 可以通过 ghcup 安装,VSCode 插件Haskell也可以自动安装二进制文件。

The blog post hopefully gives a better overview of the situation.这篇博客文章希望能更好地概述情况。

Based on this , you should be able to make it work with基于,您应该能够使其与

  let g:ycm_language_server = [
    \   {
    \     'name': 'haskell-language-server',
    \     'cmdline': [ 'haskell-language-server-wrapper', '--lsp' ],
    \     'filetypes': [ 'haskell', 'lhaskell' ],
    \     'project_root_files': [ 'stack.yaml', 'cabal.project', 'package.yaml', 'hie.yaml' ],
    \   },
    \ ]

Setting up Haskell via installing ghcup and then installing all the rest ( ghc , cabal , ...) via ghcup , as suggested in this answer , improves by far the experience with Vim and YCM.通过安装设置哈斯克尔ghcup然后安装所有的休息( ghccabal ,...)通过ghcup ,在提出这个答案,改善目前的Vim和YCM的经验。 (Oh, and YCM has to be up to date, clearly.) (哦,显然 YCM 必须是最新的。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM