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

那年仲夏 提交于 2021-01-27 19:13:58

问题


My target, if doable, is to have command completion for Haskell in work in Vim, via YouCompleteMe. 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.

However, since it was taking so long (it took 110 minutes!) I checked the PKGBUILD file just to discover this:

# ...
# 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:

and then you find out that hardly anybody uses haskell-ide-engine anymore but haskell-language-server. and also that ghcup can install the prebuild binaries for you

a comment from another user was

the haskell situation on Arch is not optimal, to say the least

an yet another comment (from Fendor, his answer is already below) was

HIE is not actively developed anymore. Haskell Language Server is the successor. I would recommend Haskell Language Server

which seems not in line with what you can read on YouCompleteMe issue tracker.

So what is the situation at the moment?


回答1:


Haskell IDE Engine and Haskell Language Server developer here.

It is true, Haskell IDE Engine is not actively being developed anymore. The teams of ghcide and Haskell IDE Engine have merged their efforts and created Haskell Language Server (based on ghcide as the main driver). 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. It also has a bunch of new features and will soon reach feature-parity with Haskell IDE Engine.

Haskell Language Server can be installed via ghcup, and the VSCode plugin Haskell can install the binaries automatically as well.

The blog post hopefully gives a better overview of the situation.




回答2:


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' ],
    \   },
    \ ]



回答3:


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.



来源:https://stackoverflow.com/questions/64087188/what-is-the-current-situation-for-using-vim-as-ide-for-haskell-on-archlinux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!